def get_pressed(): """ get_pressed() -> (button1, button2, button3) get the state of the mouse buttons """ check_video() state = sdl.SDL_GetMouseState(ffi.NULL, ffi.NULL) return (int((state & sdl._pygame_SDL_BUTTON(1)) != 0), int((state & sdl._pygame_SDL_BUTTON(2)) != 0), int((state & sdl._pygame_SDL_BUTTON(3)) != 0))
def _button_state(state, button): if state & sdl._pygame_SDL_BUTTON(button): return 1 return 0