<viz>.waitKeyPress

This command waits until a key is pressed and returns the key. IMPORTANT: Only use this command from within a director function

 

<viz>.waitKeyPress(
    key    

)

 

key

Which key to wait for. If no key is specified then it will wait until ANY key is pressed


Remarks

This command should only be used within a director function. When this command is called it pauses the director function and waits until the user has pressed a key and returns the key.

Return Value

The key that was pressed.

Example

def example():
   
    #wait for a keypress
    viz.waitKeyPress()
   
    viz.logNotice('Starting file operation')

    file = open('data.txt', 'r')    
   
    for line in file:
        last = line
   
    file.close()

    viz.logNotice('The last line is: ',last)
   
viz.director(example)

See also

<viz>.director
<viz>.waitFrame
<viz>.waitTime