package virtual_dom
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=7f1fa83287458114c5b0cab8aae00d69972d15e1d20a446ce13f246aacef3216
    
    
  doc/virtual_dom.keyboard/Vdom_keyboard/Variable_keyboard_event_handler/index.html
Module Vdom_keyboard.Variable_keyboard_event_handlerSource
A Variable_keyboard_event_handler.t provides a way of representing a keyboard event handler that contains both a (possibly empty) constant set of actions and a variable set of actions that depends on some 'env variable. In order to handle keyboard events or produce help text, it must first be converted to a Keyboard_event_handler.t using the function to_const_handler.
val of_const_handler : 
  ?variable_actions:('env -> Action.t list) ->
  Keyboard_event_handler.t ->
  'env tadd_variable_actions, add_variable_commands, and add_variable_disabled_keys add a new variable set of actions to a variable keyboard event handler. This does not replace any existing variable actions in the handler, but instead adds to them.
The add_*_exn and set_* functions below behave in the same was as the corresponding functions in Keyboard_event_handler.
to_const_handler evaluates the variable set of actions for the given 'env value, and combines them with the constant set of actions to create a keyboard event handler.
It is possible that for a given 'env value, multiple actions are defined for the same key. In that case, the latest variable action is used when creating the constant keyboard event handler.
Variable_handler_command and Variable_handler_action provide a way of representing commands whose keys, description and group are constant, but whose handler varies with the 'env variable.
add_variable_handler_action and add_variable_handler_command are utility functions for adding variable handler actions to an existing variable keyboard event handler. Under the hood, the variable handler action is converted to a variable action of the form 'env -> Action.t.