package bogue

  1. Overview
  2. Docs

Dealing with events

Events are simply SDL events, plus a few additional events. They are also used for primitive communication between threads.

Dependency graph

val startup : t
val mouse_enter : t
val mouse_leave : t
val var_changed : t

The var_changed event can be send to notify that some widget made a change to a global variable.

val update : t

Currently the update event is more or less equivalent to var_changed. This might change in future versions.

val buttons_down : t list
val buttons_up : t list
val pointer_motion : t list
val should_exit : Tsdl.Sdl.event -> bool

Tell if the current thread should exit. This should only be called within a widget action. We communicate via the event to decide if the thread should exit.

val will_exit : Tsdl.Sdl.event -> unit

A nice thread should do this just before terminating. May be suppressed in future versions.

val nice_delay : Tsdl.Sdl.event -> float -> unit

nice_delay ev t Wait during a delay (t seconds), but quit anyway when {!should_exit} ev is true.

val push_quit : unit -> unit

Send the SDL_QUIT event, as if the user clicked on the close button of the last existing window. It will in principle raise the Main.Exit exception and hence exit the mainloop.

val event_kind : Tsdl.Sdl.event -> [ `App_did_enter_background | `App_did_enter_foreground | `App_low_memory | `App_terminating | `App_will_enter_background | `App_will_enter_foreground | `Clipboard_update | `Controller_axis_motion | `Controller_button_down | `Controller_button_up | `Controller_device_added | `Controller_device_remapped | `Controller_device_removed | `Dollar_gesture | `Dollar_record | `Drop_file | `Finger_down | `Finger_motion | `Finger_up | `Joy_axis_motion | `Joy_ball_motion | `Joy_button_down | `Joy_button_up | `Joy_device_added | `Joy_device_removed | `Joy_hat_motion | `Key_down | `Key_up | `Mouse_button_down | `Mouse_button_up | `Mouse_motion | `Mouse_wheel | `Multi_gesture | `Quit | `Sys_wm_event | `Text_editing | `Text_input | `Unknown of int | `User_event | `Window_event ]
OCaml

Innovation. Community. Security.