Web.UIEvent.KeyboardEvent
- Package
- purescript-web-uievents
- Repository
- purescript-web/purescript-web-uievents
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 Source
data KeyboardEvent
#fromUIEvent Source
fromUIEvent :: UIEvent -> Maybe KeyboardEvent
#toUIEvent Source
toUIEvent :: KeyboardEvent -> UIEvent
#toEvent Source
toEvent :: KeyboardEvent -> Event
#key Source
key :: KeyboardEvent -> String
A non-empty Unicode character string containing the printable representation of the key, if available.
#code Source
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 Source
locationIndex :: KeyboardEvent -> Int
#location Source
location :: Partial => KeyboardEvent -> KeyLocation
#KeyLocation Source
#toEnumKeyLocation Source
toEnumKeyLocation :: Int -> Maybe KeyLocation
#ctrlKey Source
ctrlKey :: KeyboardEvent -> Boolean
#shiftKey Source
shiftKey :: KeyboardEvent -> Boolean
#altKey Source
altKey :: KeyboardEvent -> Boolean
#metaKey Source
metaKey :: KeyboardEvent -> Boolean
#repeat Source
repeat :: KeyboardEvent -> Boolean
#isComposing Source
isComposing :: KeyboardEvent -> Boolean
#getModifierState Source
getModifierState :: String -> KeyboardEvent -> Effect Boolean
- Modules
- Web.
UIEvent. CompositionEvent - Web.
UIEvent. CompositionEvent. EventTypes - Web.
UIEvent. EventTypes - Web.
UIEvent. FocusEvent - Web.
UIEvent. FocusEvent. EventTypes - Web.
UIEvent. InputEvent - Web.
UIEvent. InputEvent. EventTypes - Web.
UIEvent. InputEvent. InputType - Web.
UIEvent. KeyboardEvent - Web.
UIEvent. KeyboardEvent. EventTypes - Web.
UIEvent. MouseEvent - Web.
UIEvent. MouseEvent. EventTypes - Web.
UIEvent. UIEvent - Web.
UIEvent. WheelEvent - Web.
UIEvent. WheelEvent. EventTypes