Open topic with navigation
<viztask>.waitButtonDown
Wait for a specified GUI button press
<viztask>.waitButtonDown( |
|
button |
) |
|
button
Button to wait for.
If button is a sequence, then the Condition will wait for one of the buttons to be pressed.
If button is None, then the Condition will wait for any button to be pressed.
Remarks
This command will create a Condition object that will wait for the specified GUI object to be pressed.
The yielded command returns a
viz.Data object with the following information about the condition:
button | The button that was pressed |
time | The precise time of the button press |
Return Value
viztask.Condition object
Example
import viztask
mybutton = viz.addButton( pos = (0.5,0.5,0) )
def MyTask():
while True:
yield viztask.waitButtonDown(mybutton)
print('My button was pressed')
viztask.schedule( MyTask() )
See also