package ocamlsdl

  1. Overview
  2. Docs
exception Event_exn of string
type active_state =
  1. | MOUSEFOCUS
  2. | INPUTFOCUS
  3. | APPACTIVE
val get_app_state : unit -> active_state list
type active_event = {
  1. gain : bool;
  2. ae_state : active_state list;
}
type switch_state =
  1. | RELEASED
  2. | PRESSED
type keyboard_event = {
  1. ke_which : int;
  2. ke_state : switch_state;
  3. keysym : Sdlkey.t;
  4. keymod : Sdlkey.mod_state;
  5. keycode : char;
  6. unicode : int;
}
type mousemotion_event = {
  1. mme_which : int;
  2. mme_state : Sdlmouse.button list;
  3. mme_x : int;
  4. mme_y : int;
  5. mme_xrel : int;
  6. mme_yrel : int;
}
type mousebutton_event = {
  1. mbe_which : int;
  2. mbe_button : Sdlmouse.button;
  3. mbe_state : switch_state;
  4. mbe_x : int;
  5. mbe_y : int;
}
type joyaxis_event = {
  1. jae_which : int;
  2. jae_axis : int;
  3. jae_value : int;
}
type joyball_event = {
  1. jle_which : int;
  2. jle_ball : int;
  3. jle_xrel : int;
  4. jle_yrel : int;
}
type joyhat_event = {
  1. jhe_which : int;
  2. jhe_hat : int;
  3. jhe_value : int;
}
type joybutton_event = {
  1. jbe_which : int;
  2. jbe_button : int;
  3. jbe_state : switch_state;
}
type event =
  1. | ACTIVE of active_event
  2. | KEYDOWN of keyboard_event
  3. | KEYUP of keyboard_event
  4. | MOUSEMOTION of mousemotion_event
  5. | MOUSEBUTTONDOWN of mousebutton_event
  6. | MOUSEBUTTONUP of mousebutton_event
  7. | JOYAXISMOTION of joyaxis_event
  8. | JOYBALLMOTION of joyball_event
  9. | JOYHATMOTION of joyhat_event
  10. | JOYBUTTONDOWN of joybutton_event
  11. | JOYBUTTONUP of joybutton_event
  12. | QUIT
  13. | SYSWM
  14. | VIDEORESIZE of int * int
  15. | VIDEOEXPOSE
  16. | USER of int
val string_of_event : event -> string
type event_mask = int
val active_mask : event_mask
val keydown_mask : event_mask
val keyup_mask : event_mask
val mousemotion_mask : event_mask
val mousebuttondown_mask : event_mask
val mousebuttonup_mask : event_mask
val joyaxismotion_mask : event_mask
val joyballmotion_mask : event_mask
val joyhatmotion_mask : event_mask
val joybuttondown_mask : event_mask
val joybuttonup_mask : event_mask
val quit_mask : event_mask
val syswmevent_mask : event_mask
val videoresize_mask : event_mask
val videoexpose_mask : event_mask
val userevent_mask : event_mask
val keyboard_event_mask : event_mask
val mouse_event_mask : event_mask
val joystick_event_mask : event_mask
val all_events_mask : event_mask
type event_kind =
  1. | ACTIVE_EVENT
  2. | KEYDOWN_EVENT
  3. | KEYUP_EVENT
  4. | MOUSEMOTION_EVENT
  5. | MOUSEBUTTONDOWN_EVENT
  6. | MOUSEBUTTONUP_EVENT
  7. | JOYAXISMOTION_EVENT
  8. | JOYBALL_EVENT
  9. | JOYHAT_EVENT
  10. | JOYBUTTONDOWN_EVENT
  11. | JOYBUTTONUP_EVENT
  12. | QUIT_EVENT
  13. | SYSWM_EVENT
  14. | RESIZE_EVENT
  15. | EXPOSE_EVENT
  16. | USER_EVENT
val make_mask : event_kind list -> event_mask
val of_mask : event_mask -> event_kind list
val enable_events : event_mask -> unit
val disable_events : event_mask -> unit
val get_enabled_events : unit -> event_mask
val get_state : event_kind -> bool
val set_state : bool -> event_kind -> unit
val pump : unit -> unit
val wait_event : unit -> event
val wait : unit -> unit
val poll : unit -> event option
val has_event : unit -> bool
val peek : ?mask:event_mask -> int -> event list
val get : ?mask:event_mask -> int -> event list
val add : event list -> unit
module Old : sig ... end
OCaml

Innovation. Community. Security.