Module Ev.Keyboard

Keyboard events.

module Location : sig ... end

Key locations.

type t

The type for KeyboardEvent objects.

val key : t -> Jstr.t

key k is the key attribute value of k. This value is affected by the current keyboard layout and modifier keys.

val code : t -> Jstr.t

code k is a string that identifies the physical key of the event. This value is affected by the current keyboard layout or modifier state.

val location : t -> Location.t

location k is the key location of k.

val repeat : t -> bool

repeat k is true if the key has been pressed in a sustained manner.

val is_composing : t -> bool

is_composing k is true if the event occurs between compositionstart and compositionend events.

val alt_key : t -> bool

alt_key k is true if Alt modifier is active.

val ctrl_key : t -> bool

ctrl_key k is true if Control modifier is active.

val shift_key : t -> bool

shift_key k is true if Shift modifier is active.

val meta_key : t -> bool

meta_key k is true if Meta modifier is active.

val get_modifier_state : t -> Jstr.t -> bool

get_modifier_state m key is true if key is active. See here for key values.