Sdl.Event
event
accessors and event_type
constants and enumeration.
Once you have determined the typ
you can access fields available for that type. Safe if you use the wrong accessors: you will just end with garbage data.
val create : unit -> event
create ()
is an uninitialized event structure.
val first_event : event_type
val last_event : event_type
These fields are common to all event types.
val typ : event_type field
val app_did_enter_background : event_type
val app_did_enter_foreground : event_type
val app_low_memory : event_type
val app_terminating : event_type
val app_will_enter_background : event_type
val app_will_enter_foreground : event_type
val clipboard_update : event_type
val controller_axis_motion : event_type
val controller_button_down : event_type
val controller_button_up : event_type
val controller_device_added : event_type
val controller_device_remapped : event_type
val controller_device_removed : event_type
val controller_axis_which : joystick_id field
val controller_axis_axis : Controller.axis field
val controller_button_which : joystick_id field
val controller_button_button : Controller.button field
val controller_button_state : button_state field
val controller_device_which : joystick_id field
val dollar_gesture : event_type
val dollar_record : event_type
val dollar_gesture_gesture_id : gesture_id field
val dollar_gesture_num_fingers : int field
val dollar_gesture_error : float field
val dollar_gesture_x : float field
val dollar_gesture_y : float field
Warning If you enable this event drop_file_free
must be called on the event after you have finished processing it.
val drop_file : event_type
val drop_text : event_type
val drop_begin : event_type
val drop_complete : event_type
val drop_file_free : event -> unit
val drop_file_file : event -> string option
val drop_window_id : int field
val finger_down : event_type
val finger_motion : event_type
val finger_up : event_type
val touch_finger_x : float field
val touch_finger_y : float field
val touch_finger_dx : float field
val touch_finger_dy : float field
val touch_finger_pressure : float field
val joy_axis_motion : event_type
val joy_ball_motion : event_type
val joy_button_down : event_type
val joy_button_up : event_type
val joy_device_added : event_type
val joy_device_removed : event_type
val joy_hat_motion : event_type
val joy_axis_which : joystick_id field
val joy_ball_which : joystick_id field
val joy_ball_xrel : int field
val joy_ball_yrel : int field
val joy_button_which : joystick_id field
val joy_button_state : button_state field
val joy_device_which : joystick_id field
val joy_hat_which : joystick_id field
val key_down : event_type
val key_up : event_type
val keymap_changed : event_type
val keyboard_window_id : int field
val keyboard_state : button_state field
val keyboard_repeat : int field
val mouse_button_down : event_type
val mouse_button_up : event_type
val mouse_motion : event_type
val mouse_wheel : event_type
val mouse_button_window_id : int field
val mouse_button_state : button_state field
val mouse_button_x : int field
SDL 2.0.2
val mouse_button_y : int field
val mouse_motion_window_id : int field
val mouse_motion_x : int field
val mouse_motion_y : int field
val mouse_motion_xrel : int field
val mouse_motion_yrel : int field
val mouse_wheel_normal : mouse_wheel_direction
val mouse_wheel_flipped : mouse_wheel_direction
val mouse_wheel_window_id : int field
val mouse_wheel_x : int field
val mouse_wheel_y : int field
val mouse_wheel_direction : mouse_wheel_direction field
2.04
val multi_gesture : event_type
val multi_gesture_dtheta : float field
val multi_gesture_ddist : float field
val multi_gesture_x : float field
val multi_gesture_y : float field
val multi_gesture_num_fingers : int field
val quit : event_type
val sys_wm_event : event_type
val text_editing : event_type
val text_input : event_type
val text_editing_window_id : int field
val text_editing_text : string field
val text_editing_start : int field
val text_editing_length : int field
val text_input_window_id : int field
val text_input_text : string field
val user_event : event_type
val user_window_id : int field
val user_code : int field
val display_event : event_type
val display_display : int32 field
val display_event_id : int field
val display_data1 : int32 field
val sensor_update : event_type
val sensor_which : int32 field
val sensor_data0 : float field
val sensor_data1 : float field
val sensor_data2 : float field
val sensor_data3 : float field
val sensor_data4 : float field
val sensor_data5 : float field
val window_event : event_type
type window_event_enum = [
| `Close
| `Enter
| `Exposed
| `Focus_gained
| `Focus_lost
| `Hidden
| `Hit_test
| `Leave
| `Maximized
| `Minimized
| `Moved
| `Resized
| `Restored
| `Shown
| `Size_changed
| `Take_focus
| `Unknown of window_event_id
]
val window_event_enum : window_event_id -> window_event_enum
val window_event_shown : window_event_id
val window_event_exposed : window_event_id
val window_event_moved : window_event_id
val window_event_resized : window_event_id
val window_event_size_changed : window_event_id
val window_event_minimized : window_event_id
val window_event_maximized : window_event_id
val window_event_restored : window_event_id
val window_event_enter : window_event_id
val window_event_leave : window_event_id
val window_event_focus_gained : window_event_id
val window_event_focus_lost : window_event_id
val window_event_close : window_event_id
val window_event_take_focus : window_event_id
val window_event_hit_test : window_event_id
val window_window_id : int field
val window_event_id : window_event_id field
val window_data1 : int32 field
val window_data2 : int32 field
val render_targets_reset : event_type
val render_device_reset : event_type
val audio_device_added : event_type
val audio_device_removed : event_type
val audio_device_is_capture : int field
type enum = [
| `App_did_enter_background
| `App_did_enter_foreground
| `App_low_memory
| `App_terminating
| `App_will_enter_background
| `App_will_enter_foreground
| `Audio_device_added
| `Audio_device_removed
| `Clipboard_update
| `Controller_axis_motion
| `Controller_device_added
| `Controller_device_remapped
| `Controller_device_removed
| `Dollar_gesture
| `Dollar_record
| `Drop_begin
| `Drop_complete
| `Drop_file
| `Drop_text
| `Finger_down
| `Finger_motion
| `Finger_up
| `Keymap_changed
| `Joy_axis_motion
| `Joy_ball_motion
| `Joy_device_added
| `Joy_device_removed
| `Joy_hat_motion
| `Key_down
| `Key_up
| `Mouse_motion
| `Mouse_wheel
| `Multi_gesture
| `Quit
| `Render_targets_reset
| `Render_device_reset
| `Sys_wm_event
| `Text_editing
| `Text_input
| `Unknown of int
| `User_event
| `Window_event
| `Display_event
| `Sensor_update
]
val enum : event_type -> enum