package virtual_dom
OCaml bindings for the virtual-dom library
Install
Dune Dependency
Authors
Maintainers
Sources
v0.15.1.tar.gz
sha256=7f1fa83287458114c5b0cab8aae00d69972d15e1d20a446ce13f246aacef3216
doc/src/virtual_dom.keyboard/keyboard_event.ml.html
Source file keyboard_event.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
open! Core open Import open Dom_html type t = keyboardEvent Js.t module Keyboard_code = Keyboard_code let key e = Keyboard_code.of_event e let ctrl e = Js.to_bool e##.ctrlKey let alt e = Js.to_bool e##.altKey let shift e = Js.to_bool e##.shiftKey let meta e = Js.to_bool e##.metaKey let match_modifiers ?ctrl:ctrl' ?alt:alt' ?shift:shift' ?meta:meta' e = List.for_all [ ctrl', ctrl e; alt', alt e; shift', shift e; meta', meta e ] ~f:(fun (cond, env) -> Option.value_map cond ~default:true ~f:(Bool.equal env)) ;; let no_modifiers e = match_modifiers ~ctrl:false ~alt:false ~shift:false ~meta:false e let map e ~f = f (`Ctrl (ctrl e), `Alt (alt e), `Shift (shift e), `Meta (meta e), key e)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>