sig
exception SDLjoystick_exception of string
type t
external num_joysticks : unit -> int = "ml_SDL_NumJoysticks"
external name : int -> string = "ml_SDL_JoystickName"
external open_joystick : int -> Sdljoystick.t = "ml_SDL_JoystickOpen"
external opened : int -> bool = "ml_SDL_JoystickOpened"
external index : Sdljoystick.t -> int = "ml_SDL_JoystickIndex"
external num_axes : Sdljoystick.t -> int = "ml_SDL_JoystickNumAxes"
external num_balls : Sdljoystick.t -> int = "ml_SDL_JoystickNumBalls"
external num_hats : Sdljoystick.t -> int = "ml_SDL_JoystickNumHats"
external num_buttons : Sdljoystick.t -> int = "ml_SDL_JoystickNumButtons"
external update : Sdljoystick.t -> unit = "ml_SDL_JoystickUpdate"
external set_event_state : bool -> unit = "ml_SDL_JoystickSetEventState"
external get_event_state : unit -> bool = "ml_SDL_JoystickGetEventState"
type hat_value = int
val hat_centered : Sdljoystick.hat_value
val hat_up : Sdljoystick.hat_value
val hat_right : Sdljoystick.hat_value
val hat_down : Sdljoystick.hat_value
val hat_left : Sdljoystick.hat_value
val hat_rightup : Sdljoystick.hat_value
val hat_rightdown : Sdljoystick.hat_value
val hat_leftup : Sdljoystick.hat_value
val hat_leftdown : Sdljoystick.hat_value
external get_axis : Sdljoystick.t -> int -> int = "ml_SDL_JoystickGetAxis"
external get_hat : Sdljoystick.t -> int -> Sdljoystick.hat_value
= "ml_SDL_JoystickGetHat"
external get_ball : Sdljoystick.t -> int -> int * int
= "ml_SDL_JoystickGetBall"
external get_button : Sdljoystick.t -> int -> bool
= "ml_SDL_JoystickGetButton"
external close : Sdljoystick.t -> unit = "ml_SDL_JoystickClose"
end