![]() |
|
#4
|
|||
|
|||
Hi,
The upcoming version of Vizard will allow you to create callbacks for joystick buttons, but for now you'll have to manually check when a button is first pressed. Here's a simple example: Code:
import viz import sid viz.go() laststate = sid.buttons() def mytimer(num): global laststate state = sid.buttons() if state & 1 and not laststate & 1: print 'button pressed down' laststate = state viz.callback(viz.TIMER_EVENT,mytimer) viz.starttimer(0,0.001,viz.FOREVER) |
|
|