Esempio n. 1
0
 def get_button(self, i):
     """ get_button(button) -> bool
     get the current button state
     """
     joydata = self._joydata
     if i < 0 or i >= sdl.SDL_JoystickNumButtons(joydata):
         raise SDLError("Invalid joystick button")
     return sdl.SDL_JoystickGetButton(joydata, i)
Esempio n. 2
0
 def get_numbuttons(self):
     """ get_numbuttons() -> int
     get the number of buttons on a Joystick
     """
     return sdl.SDL_JoystickNumButtons(self._joydata)