WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   multiple mouse clicks (https://forum.worldviz.com/showthread.php?t=1518)

jaclyn.bill 06-02-2008 08:38 AM

multiple mouse clicks
 
Dear users,

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

Code:

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:
Code:

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:
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


All times are GMT -7. The time now is 04:23 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC