PDA

View Full Version : multiple mouse clicks


jaclyn.bill
06-02-2008, 08:38 AM
Dear users,

Sorry if this is a simple question but it there anything I can add to

def BallFlight():

#Wait for left mouse button to be pressed
yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)

so that vizard waits for more than one mouse click before starting my stimulus?

thank you.

Best, J

farshizzo
06-02-2008, 07:56 PM
Sure, just yield the mouse down condition multiple time. For example:def BallFlight():

#Wait for left mouse button to be pressed twice
yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)If the number of mouse click is some variable amount, then you can use the following code:NUM_CLICKS = 2
def BallFlight():

#Wait for left mouse button to be pressed twice
for x in range(NUM_CLICKS):
yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)

jaclyn.bill
06-03-2008, 02:19 AM
ah, it was that obvious, thank you!

Best, J