WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 04-15-2010, 02:11 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I believe the following code should do what you want:
Code:
class Experiment:

	# This method is called somewhere...
	def start_green_face_task(self):
		viztask.schedule( self.test_reaction_time() )
		
	def test_reaction_time(self):
		self.avatar_to_morph().make_green_face()
		yield viztask.waitKeyDown('P') # Here the code should stop until this method returns (when the user presses P)! But how can this be achieved?
		self.end_green_face_task() # This method should be called *after* the user presses P!
		
	def end_green_face_task(self):
		self.avatar_to_morph().remove_green_face()
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
return variable from keypress function starbug Vizard 2 01-07-2010 11:14 AM
return IDE to default config billjarrold Vizard 2 12-10-2009 06:05 PM
Sit, stay, wait? EnvisMJ Vizard 1 05-20-2009 04:36 PM
Unexpected carriage return vizmaster Vizard 3 01-23-2007 12:46 PM
plug-ins that return quaternions hotspur1 Vizard 2 02-05-2004 07:47 PM


All times are GMT -7. The time now is 09:33 PM.


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