Stk.Wkey
Convenient functions to handle key press events in widgets.
val add :
Widget.widget ->
?cond:(unit -> bool) ->
Key.keystate ->
(unit -> unit) ->
unit
add widget keystate callback
associates the callback
function to the event "key_press" with the given keystate
for the given widget
.
The optional parameter conf
is a guard: the callback
function is not called if the cond
function returns false
. The default cond
function always returns true
.
val add_list :
Widget.widget ->
?cond:(unit -> bool) ->
Key.keystate list ->
(unit -> unit) ->
unit
add_list widget ?cond list callback
calls add widget ?cond ks callback
for each keystate ks
of the given list
.
val set :
Widget.widget ->
?cond:(unit -> bool) ->
Key.keystate ->
(unit -> unit) ->
unit
Like add
but the previous handlers for the given keystate are not kept.
val set_list :
Widget.widget ->
?cond:(unit -> bool) ->
Key.keystate list ->
(unit -> unit) ->
unit
set_list widget ?cond list callback
calls set widget ?cond ks callback
for each keystate ks
of the given list
.
The keys which are ignored when they are pressed alone.
val string_of_handler_trees : handler_tree list -> string
val pp_handler_trees : Stdlib.Format.formatter -> handler_tree list -> unit
val reset_state : Widget.widget -> unit
val set_handler_trees :
?stop:Key.keystate ->
(unit -> handler_tree list) ->
?display_state:(after_handler:bool -> keyhit_state -> unit) ->
Widget.widget ->
unit
val handler : ?cond:(unit -> bool) -> (unit -> unit) -> handler
val handler_tree : Key.keystate -> handler_tree_node -> handler_tree
val trees_of_list :
(Key.keystate list * (unit -> unit)) list ->
handler_tree list
val string_of_keyhit_state : keyhit_state -> string
val pp_keyhit_state : Stdlib.Format.formatter -> keyhit_state -> unit