WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   pausing director/timer functions (https://forum.worldviz.com/showthread.php?t=492)

mikestatic 01-25-2006 09:48 AM

pausing director/timer functions
 
I am looking for a method to automatically pause a director function (i.e. swapimage) at particular points during the script (to await verbal feedback from participants) and have a keyboard function that unpauses the script and continues to the next event. I have tried the pause command, but I may have been misusing it. I am open to trying a timer event if that is more appropriate. Regardless, I will need to pause and unpause about 40 times throughout the director function; therefore I don't think that I can use multiple swapimage commands attached to different keystrokes as I may not have enough keys.
Below is part of the code I currently use to present the stimuli without a pause between each picture. I want to beable to pause and unpause at the points marked #.

def swapimage1 ():
screen.texture(waitperiod)
viz.waitframe(20)
#
screen.texture(fixation)
viz.waitframe(10)
screen.texture(stim01)
viz.waitframe(5)
#
screen.texture(fixation)
viz.waitframe(10)
screen.texture(stim02)
viz.waitframe(5)
#
screen.texture(fixation)
viz.waitframe(10)
screen.texture(stim03)
viz.waitframe(5)
#
screen.texture(fixation)
viz.waitframe(10)
screen.texture(stim04)
viz.waitframe(5)

Please let me know if I need to clarify any portion of this request. Thank you very much for your help.

farshizzo 01-25-2006 10:02 AM

Hi,

If you only need to wait for a key press then use the viz.waitkey command. For example, if you wanted to wait for the spacebar to be pressed you would do the following inside your director function:
Code:

viz.waitkey(' ')

mikestatic 01-25-2006 10:15 AM

works great!
 
viz.waitkeypress(' ')

Thanks. It is a very easy solution!


All times are GMT -7. The time now is 07:05 AM.

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