WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-02-2008, 08:38 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
multiple mouse clicks

Dear users,

Sorry if this is a simple question but it there anything I can add to

Code:
def BallFlight():
	
	#Wait for left mouse button to be pressed
	yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
so that vizard waits for more than one mouse click before starting my stimulus?

thank you.

Best, J
Reply With Quote
  #2  
Old 06-02-2008, 07:56 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Sure, just yield the mouse down condition multiple time. For example:
Code:
def BallFlight():
	
	#Wait for left mouse button to be pressed twice
	yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
	yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
If the number of mouse click is some variable amount, then you can use the following code:
Code:
NUM_CLICKS = 2
def BallFlight():
	
	#Wait for left mouse button to be pressed twice
	for x in range(NUM_CLICKS):
		yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
Reply With Quote
  #3  
Old 06-03-2008, 02:19 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
ah, it was that obvious, thank you!

Best, J
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
Picking in multiple windows FalconNL Vizard 1 07-02-2007 09:45 AM
Multiple Stages in one Program Amit Vizard 7 11-11-2005 10:20 AM
Mouse problem steve Vizard 7 07-14-2005 03:01 PM
Draw Line between Points selected by mouse Johannes Vizard 7 01-07-2005 02:50 PM
Halting mouse view-transforms FlyingWren Vizard 1 10-01-2003 05:29 PM


All times are GMT -7. The time now is 08:04 PM.


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