View Single Post
  #1  
Old 06-04-2010, 05:32 AM
4711 4711 is offline
Member
 
Join Date: Jan 2010
Posts: 15
Simple Joystick Question

Hi all,

I have a question concerning the joystick buttons which is probably rather easy to be answered: How can I make my script to wait for the user to press one of the two buttons of a connected joystick.

My guess was:
Code:
import viz
import vizjoy
import viztask

viz.go()

joystick = vizjoy.add()

def WaitForButtonPress():
	yield viztask.waitButtonDown(None)
	print "Done."
	viz.quit()
	
viztask.schedule( WaitForButtonPress() )
It works fine if one replaces the "Button" by "Key" in the yield-expression, so I would have expected it to run for the joystick buttons as well. However, it does not, so what works?
Reply With Quote