sig
exception Event_exn of string
type active_state = MOUSEFOCUS | INPUTFOCUS | APPACTIVE
external get_app_state : unit -> Sdlevent.active_state list
= "mlsdlevent_get_app_state"
type active_event = { gain : bool; ae_state : Sdlevent.active_state list; }
type switch_state = RELEASED | PRESSED
type keyboard_event = {
ke_which : int;
ke_state : Sdlevent.switch_state;
keysym : Sdlkey.t;
keymod : Sdlkey.mod_state;
keycode : char;
}
type mousemotion_event = {
mme_which : int;
mme_state : Sdlmouse.button list;
mme_x : int;
mme_y : int;
mme_xrel : int;
mme_yrel : int;
}
type mousebutton_event = {
mbe_which : int;
mbe_button : Sdlmouse.button;
mbe_state : Sdlevent.switch_state;
mbe_x : int;
mbe_y : int;
}
type joyaxis_event = { jae_which : int; jae_axis : int; jae_value : int; }
type joyball_event = {
jle_which : int;
jle_ball : int;
jle_xrel : int;
jle_yrel : int;
}
type joyhat_event = { jhe_which : int; jhe_hat : int; jhe_value : int; }
type joybutton_event = {
jbe_which : int;
jbe_button : int;
jbe_state : Sdlevent.switch_state;
}
type event =
ACTIVE of Sdlevent.active_event
| KEYDOWN of Sdlevent.keyboard_event
| KEYUP of Sdlevent.keyboard_event
| MOUSEMOTION of Sdlevent.mousemotion_event
| MOUSEBUTTONDOWN of Sdlevent.mousebutton_event
| MOUSEBUTTONUP of Sdlevent.mousebutton_event
| JOYAXISMOTION of Sdlevent.joyaxis_event
| JOYBALLMOTION of Sdlevent.joyball_event
| JOYHATMOTION of Sdlevent.joyhat_event
| JOYBUTTONDOWN of Sdlevent.joybutton_event
| JOYBUTTONUP of Sdlevent.joybutton_event
| QUIT
| SYSWM
| VIDEORESIZE of int * int
| VIDEOEXPOSE
| USER of int
val string_of_event : Sdlevent.event -> string
type event_mask = int
val active_mask : Sdlevent.event_mask
val keydown_mask : Sdlevent.event_mask
val keyup_mask : Sdlevent.event_mask
val mousemotion_mask : Sdlevent.event_mask
val mousebuttondown_mask : Sdlevent.event_mask
val mousebuttonup_mask : Sdlevent.event_mask
val joyaxismotion_mask : Sdlevent.event_mask
val joyballmotion_mask : Sdlevent.event_mask
val joyhatmotion_mask : Sdlevent.event_mask
val joybuttondown_mask : Sdlevent.event_mask
val joybuttonup_mask : Sdlevent.event_mask
val quit_mask : Sdlevent.event_mask
val syswmevent_mask : Sdlevent.event_mask
val videoresize_mask : Sdlevent.event_mask
val videoexpose_mask : Sdlevent.event_mask
val userevent_mask : Sdlevent.event_mask
val keyboard_event_mask : Sdlevent.event_mask
val mouse_event_mask : Sdlevent.event_mask
val joystick_event_mask : Sdlevent.event_mask
val all_events_mask : Sdlevent.event_mask
type event_kind =
ACTIVE_EVENT
| KEYDOWN_EVENT
| KEYUP_EVENT
| MOUSEMOTION_EVENT
| MOUSEBUTTONDOWN_EVENT
| MOUSEBUTTONUP_EVENT
| JOYAXISMOTION_EVENT
| JOYBALL_EVENT
| JOYHAT_EVENT
| JOYBUTTONDOWN_EVENT
| JOYBUTTONUP_EVENT
| QUIT_EVENT
| SYSWM_EVENT
| RESIZE_EVENT
| EXPOSE_EVENT
| USER_EVENT
val make_mask : Sdlevent.event_kind list -> Sdlevent.event_mask
val of_mask : Sdlevent.event_mask -> Sdlevent.event_kind list
val enable_events : Sdlevent.event_mask -> unit
val disable_events : Sdlevent.event_mask -> unit
external get_enabled_events : unit -> Sdlevent.event_mask
= "mlsdlevent_get_enabled"
external get_state : Sdlevent.event_kind -> bool = "mlsdlevent_get_state"
external set_state : bool -> Sdlevent.event_kind -> unit
= "mlsdlevent_set_state"
val pump : unit -> unit
val wait_event : unit -> Sdlevent.event
external wait : unit -> unit = "mlsdlevent_wait"
val poll : unit -> Sdlevent.event option
external has_event : unit -> bool = "mlsdlevent_has_event"
external peek : ?mask:Sdlevent.event_mask -> int -> Sdlevent.event list
= "mlsdlevent_peek"
external get : ?mask:Sdlevent.event_mask -> int -> Sdlevent.event list
= "mlsdlevent_get"
external add : Sdlevent.event list -> unit = "mlsdlevent_add"
module Old :
sig
type keyboard_event_func =
Sdlkey.t -> Sdlevent.switch_state -> int -> int -> unit
type mouse_event_func =
Sdlmouse.button -> Sdlevent.switch_state -> int -> int -> unit
type mousemotion_event_func = int -> int -> unit
type idle_event_func = unit -> unit
type resize_event_func = int -> int -> unit
val set_keyboard_event_func : Sdlevent.Old.keyboard_event_func -> unit
val set_mouse_event_func : Sdlevent.Old.mouse_event_func -> unit
val set_mousemotion_event_func :
Sdlevent.Old.mousemotion_event_func -> unit
val set_idle_event_func : Sdlevent.Old.idle_event_func -> unit
val set_resize_event_func : Sdlevent.Old.resize_event_func -> unit
val start_event_loop : unit -> unit
val exit_event_loop : unit -> unit
end
val link_me : unit
end