View Single Post
  #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