Skip to content

Instantly share code, notes, and snippets.

@chozabu
Created January 5, 2015 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chozabu/0c01baeb85f3680ffdc1 to your computer and use it in GitHub Desktop.
Save chozabu/0c01baeb85f3680ffdc1 to your computer and use it in GitHub Desktop.
win = Window
win.bind(on_keyboard=self.my_key_handler)
win.bind(on_joy_axis=self.my_axis_handler)
win.bind(on_joy_hat=self.printe)
win.bind(on_joy_ball=self.printe)
win.bind(on_joy_button_down=self.my_jbutton_down)
win.bind(on_joy_button_up=self.printe)
def printe(self, window, stickid, a=0,b=0,c=0,d=0,e=0):
print a,b,c,d,e
return False
def my_jbutton_down(self, window, stickid, buttonid):
if self.current_menu_ref == self.menu:
self.menu.playGame(None)
self.current_menu_ref.on_back()
return False
def my_axis_handler(self, window, stickid, axisid, value):
riders.sendinput(stickid,axisid,value)
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment