View Single Post
  #2  
Old 12-16-2009, 04:54 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,462
You can use a callback for sensor events to be notified when a button is pressed. Is this what you are looking for?
Code:
def onSensorDown(e):
    if e.object is tracker:
        print 'Button',e.button,'down'
viz.callback(viz.SENSOR_DOWN_EVENT,onSensorDown)

def onSensorUp(e):
    if e.object is tracker:
        print 'Button',e.button,'up'
viz.callback(viz.SENSOR_UP_EVENT,onSensorUp)
Reply With Quote