Module

Web.UIEvent.KeyboardEvent

Functions that expose the KeyboardEvent API.

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent

Note: The deprecated attributes .keyCode, .charCode, and .which are deliberately omitted. It is currently recommended to use KeyboardEvent.key instead.

If browser support for KeyboardEvent.key is not yet widespread enough for your use case, consider using a polyfill (e.g. https://github.com/inexorabletash/polyfill#keyboard-events) or use the purescript FFI to access the deprecated attributes you want to work with.

#KeyboardEvent

#key

key :: KeyboardEvent -> String

A non-empty Unicode character string containing the printable representation of the key, if available.

#code

code :: KeyboardEvent -> String

Returns a string representing a physical key on the keyboard. Not affected by keyboard layout or state of the modifier keys.

#locationIndex

#toEnumKeyLocation

#fromEnumKeyLocation

Modules