package ocamlsdl2

  1. Overview
  2. Docs
type state =
  1. | Released
  2. | Pressed
val string_of_state : state -> string
type keyboard_event = {
  1. ke_timestamp : int32;
  2. ke_window_id : int32;
  3. ke_state : state;
  4. ke_repeat : int;
  5. scancode : Sdlscancode.t;
  6. keycode : Sdlkeycode.t;
  7. keymod : Sdlkeymod.t list;
}
type mouse_motion_event = {
  1. mm_timestamp : int32;
  2. mm_window_id : int32;
  3. mm_buttons : int list;
  4. mm_x : int;
  5. mm_y : int;
  6. mm_xrel : int;
  7. mm_yrel : int;
}
type mouse_button_event = {
  1. mb_timestamp : int32;
  2. mb_window_id : int32;
  3. mb_button : int;
  4. mb_state : state;
  5. mb_x : int;
  6. mb_y : int;
}
type mouse_wheel_event = {
  1. mw_timestamp : int32;
  2. mw_window_id : int32;
  3. mw_x : int;
  4. mw_y : int;
}
type joy_axis_event = {
  1. ja_timestamp : int32;
  2. ja_which : int;
  3. ja_axis : int;
  4. ja_value : int;
}
type joy_button_event = {
  1. jb_timestamp : int32;
  2. jb_which : int;
  3. jb_button : int;
  4. jb_state : state;
}
type joy_hat_event = {
  1. jh_timestamp : int32;
  2. jh_which : int;
  3. jh_hat : int;
  4. jh_dir : Sdlhat.direction;
  5. jh_pos : Sdlhat.positions;
}
type joy_device_change =
  1. | JoyDevice_Added
  2. | JoyDevice_Removed
val string_of_joy_device_change : joy_device_change -> string
type joy_device_event = {
  1. jd_timestamp : int32;
  2. jd_which : int;
  3. jd_change : joy_device_change;
}
type window_event_xy = {
  1. win_x : int;
  2. win_y : int;
}
type window_event_kind =
  1. | WindowEvent_None
  2. | WindowEvent_Shown
  3. | WindowEvent_Hidden
  4. | WindowEvent_Exposed
  5. | WindowEvent_Moved of window_event_xy
  6. | WindowEvent_Resized of window_event_xy
  7. | WindowEvent_Size_Changed of window_event_xy
  8. | WindowEvent_Minimized
  9. | WindowEvent_Maximized
  10. | WindowEvent_Restored
  11. | WindowEvent_Enter
  12. | WindowEvent_Leave
  13. | WindowEvent_Focus_Gained
  14. | WindowEvent_Focus_Lost
  15. | WindowEvent_Close
  16. | WindowEvent_Take_Focus
  17. | WindowEvent_Hit_Test
val string_of_window_event_kind : window_event_kind -> string
type window_event = {
  1. we_timestamp : int32;
  2. window_ID : int32;
  3. kind : window_event_kind;
}
type quit_event = {
  1. quit_timestamp : int32;
}
type text_editing_event = {
  1. te_timestamp : int32;
  2. te_window_ID : int32;
  3. te_text : string;
  4. te_begin : int;
  5. te_length : int;
}
type text_input_event = {
  1. ti_timestamp : int32;
  2. ti_window_ID : int32;
  3. ti_text : string;
}
type t =
  1. | Quit of quit_event
  2. | Mouse_Motion of mouse_motion_event
  3. | Mouse_Button_Down of mouse_button_event
  4. | Mouse_Button_Up of mouse_button_event
  5. | Mouse_Wheel of mouse_wheel_event
  6. | KeyDown of keyboard_event
  7. | KeyUp of keyboard_event
  8. | Text_Editing of text_editing_event
  9. | Text_Input of text_input_event
  10. | Joy_Axis_Motion of joy_axis_event
  11. | Joy_Ball_Motion
  12. | Joy_Hat_Motion of joy_hat_event
  13. | Joy_Button_Down of joy_button_event
  14. | Joy_Button_Up of joy_button_event
  15. | Joy_Device_Added of joy_device_event
  16. | Joy_Device_Removed of joy_device_event
  17. | Controller_Axis_Motion
  18. | Controller_Button_Down
  19. | Controller_Button_Up
  20. | Controller_Device_Added
  21. | Controller_Device_Removed
  22. | Finger_Down
  23. | Finger_Up
  24. | Finger_Motion
  25. | Dollar_Gesture
  26. | Dollar_Record
  27. | Multi_Gesture
  28. | Clipboard_Update
  29. | Drop_File
  30. | User_Event
  31. | Window_Event of window_event
  32. | SysWM_Event
val poll_event : unit -> t option
val to_string : t -> string
OCaml

Innovation. Community. Security.