WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-25-2006, 09:48 AM
mikestatic mikestatic is offline
Member
 
Join Date: Jan 2006
Posts: 9
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.

Last edited by mikestatic; 01-25-2006 at 09:51 AM.
Reply With Quote
  #2  
Old 01-25-2006, 10:02 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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(' ')
Reply With Quote
  #3  
Old 01-25-2006, 10:15 AM
mikestatic mikestatic is offline
Member
 
Join Date: Jan 2006
Posts: 9
Thumbs up works great!

viz.waitkeypress(' ')

Thanks. It is a very easy solution!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:14 PM.


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