A Keyboard_event_handler.t
is a collections of actions (commands and disabled keys)
that can be used to handle keyboard events and to produce help text.
module Condition : sig ... end
module Handler : sig ... end
module Command : sig ... end
module Action : sig ... end
include sig ... end
val sexp_of_t : t ‑> Base.Sexp.t
val empty : t
of_action_list_exn
and of_command_list_exn
create a keyboard event handler from a
list of actions. If the same key appears in multiple actions, an exception is
raised.
add_action_exn
, add_command_exn
, and add_disabled_key_exn
add a new action to a
keyboard event handler. If any key from the new action already exists in the handler,
an exception is raised.
val add_disabled_key_exn : t ‑> Keystroke.t ‑> t
set_action
, set_command
, and set_disabled_key
are similar to their respective
*_exn
functions, but if a key from the new action already exists in the handler,
that key's action is updated to the new action.
val set_disabled_key : t ‑> Keystroke.t ‑> t
merge_exn t1 t2
and merge t1 t2
create a new keyboard event handler containing the
actions from both t1
and t2
. If there is a duplicate key between t1
and t2
,
merge_exn
raises an exception while merge
uses the action from t2
.
val handle_event : t ‑> Keyboard_event.t ‑> Virtual_dom.Vdom.Event.t option
val get_help_text : ?include_disabled_keys:unit ‑> t ‑> Help_text.t
val get_grouped_help_text : ?include_disabled_keys:unit ‑> t ‑> default_group:Grouped_help_text.Group_name.t ‑> Grouped_help_text.t
val get_grouped_help_text_exn : ?include_disabled_keys:unit ‑> t ‑> Grouped_help_text.t