Stk.WkeySourceConvenient functions to handle key press events in widgets.
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) ->
unitadd_list widget ?cond list callback calls add widget ?cond ks callback for each keystate ks of the given list.
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) ->
unitset_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 set_handler_trees :
?stop:Key.keystate ->
(unit -> handler_tree list) ->
?display_state:(after_handler:bool -> keyhit_state -> unit) ->
Widget.widget ->
unit