package mosaic

  1. Overview
  2. Docs

Module Event.KeySource

Sourcetype t

The type for keyboard events.

Wraps an Input.Key.event with propagation and default-prevention flags that the renderer inspects during two-tier dispatch (global handlers first, then focused-node handlers).

Sourceval of_input : Input.Key.event -> t

of_input ev is a keyboard event wrapping ev. Propagation and default-prevention flags start as false.

Sourceval data : t -> Input.Key.event

data t is the underlying terminal key event.

Sourceval stop_propagation : t -> unit

stop_propagation t prevents t from reaching the focused-node handler tier. When called in a global handler, the event is not dispatched to focused-node handlers.

Sourceval propagation_stopped : t -> bool

propagation_stopped t is true iff stop_propagation has been called on t.

Sourceval prevent_default : t -> unit

prevent_default t marks renderer-level default behaviour as prevented. After all handlers run, the renderer skips its default key behaviour for the focused node.

Sourceval default_prevented : t -> bool

default_prevented t is true iff prevent_default has been called on t.

Sourceval equal : t -> t -> bool

equal a b is true iff a and b wrap the same key event. Dispatch control state is ignored.

Sourceval pp : Format.formatter -> t -> unit

pp formats a keyboard event for debugging.