WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Wait for specific cedrus key (https://forum.worldviz.com/showthread.php?t=5717)

VizMars 05-11-2016 09:28 AM

Wait for specific cedrus key
 
My cedrus handler triggers an event viz.sendEvent(CEDRUS_BUTTON_DOWN, response['key']) every time a cedrus button is pressed.

How can I pause my Experiment until a specific cedrus key is pressed (e.g. button 6 is down)?

Jeff 05-13-2016 04:02 AM

You can use viztask and the waitEvent command to wait for the cedrus button event.

VizMars 05-14-2016 10:43 AM

But in this case every cedrus button resumes my experiment.
How can I wait for a specific button? (e.g. button 6)

Jeff 05-16-2016 12:48 AM

Are you using the vizxid module to get the Cedrus data, like the example posted here? If so, you can wait for a specific button press:

Code:

#Wait for button 3 on XID to be pressed
yield vizxid.waitButtonDown(3,d)


VizMars 05-17-2016 02:29 AM

I'm using pyxid. But I'll have a closer look at the implementation of waitButtonDown.


All times are GMT -7. The time now is 01:21 AM.

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