Module
PsSpa.Event
- Package
- purescript-ps-spa
- Repository
- the-man-with-a-golden-mind/ps-spa
Opaque DOM event handed to handlers registered with PsSpa.Html.onEvent
(and its specialisations like onInput, onKeyDown, …).
The helpers in this module extract the most common pieces — value, key, modifiers, geometry — and return zeroed defaults when the field doesn't apply to the event type (so the FFI surface stays total).
Example:
onEvent "wheel" \event -> Scrolled { dy: deltaY event, ctrl: ctrlKey event }
#EventValue Source
data EventValue#targetValue Source
targetValue :: EventValue -> String#targetChecked Source
targetChecked :: EventValue -> Boolean#targetId Source
targetId :: EventValue -> String#keyName Source
keyName :: EventValue -> String#keyCode Source
keyCode :: EventValue -> Int#clientX Source
clientX :: EventValue -> Int#clientY Source
clientY :: EventValue -> Int#pageX Source
pageX :: EventValue -> Int#pageY Source
pageY :: EventValue -> Int#screenX Source
screenX :: EventValue -> Int#screenY Source
screenY :: EventValue -> Int#deltaX Source
deltaX :: EventValue -> Int#deltaY Source
deltaY :: EventValue -> Int#button Source
button :: EventValue -> Int#altKey Source
altKey :: EventValue -> Boolean#ctrlKey Source
ctrlKey :: EventValue -> Boolean#shiftKey Source
shiftKey :: EventValue -> Boolean#metaKey Source
metaKey :: EventValue -> Boolean#preventDefault Source
preventDefault :: EventValue -> Effect Unit#stopPropagation Source
stopPropagation :: EventValue -> Effect Unit