PDA

View Full Version : Wait for specific cedrus key


VizMars
05-11-2016, 09:28 AM
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 (http://docs.worldviz.com/vizard/#commands/viztask/waitEvent.htm) 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 (http://forum.worldviz.com/showpost.php?p=17934&postcount=4)? If so, you can wait for a specific button press:

#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.