package hugin

  1. Overview
  2. Docs

Module Usdl.EventSource

Sourcetype t

The type for event storage.

Sourcetype event_type = [
  1. | `Quit
  2. | `Window_event
  3. | `Key_down
  4. | `Unknown of int
]

The type for event kinds.

Sourcetype window_event = [
  1. | `Resized
  2. | `Size_changed
  3. | `Exposed
  4. | `Close
  5. | `Unknown of int
]

The type for window event sub-kinds.

Sourceval create : unit -> t

create () allocates event storage.

Sourceval wait : t -> bool

wait t blocks until an event arrives. Returns true if an event was received, false on error. Releases the runtime lock while blocking.

Sourceval typ : t -> event_type

typ t is the kind of the last received event.

Sourceval window_event_id : t -> window_event

window_event_id t is the window event sub-kind. Only meaningful when typ t is `Window_event.

Sourceval keycode : t -> int

keycode t is the key code. Only meaningful when typ t is `Key_down.