Beispiel #1
0
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))
Beispiel #2
0
def get_pos():
    check_video()
    x = ffi.new("int[1]")
    y = ffi.new("int[1]")
    sdl.SDL_GetMouseState(x, y)
    return x[0], y[0]