| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Graphics.UI.Threepenny.Events
Synopsis
- valueChange :: Element -> Event String
- selectionChange :: Element -> Event (Maybe Int)
- checkedChange :: Element -> Event Bool
- click :: Element -> Event ()
- contextmenu :: Element -> Event (Double, Double)
- mousemove :: Element -> Event (Double, Double)
- mousedown :: Element -> Event (Double, Double)
- mouseup :: Element -> Event (Double, Double)
- hover :: Element -> Event ()
- leave :: Element -> Event ()
- focus :: Element -> Event ()
- blur :: Element -> Event ()
- type KeyCode = Int
- keyup :: Element -> Event KeyCode
- keydown :: Element -> Event KeyCode
- keypress :: Element -> Event Char
- roundCoordinates :: (Double, Double) -> (Int, Int)
Synopsis
Events on DOM elements.
Convenience events
valueChange :: Element -> Event String Source #
Event that occurs when the user changes the value of the input element.
selectionChange :: Element -> Event (Maybe Int) Source #
Event that occurs when the user changes the selection of a select element.
checkedChange :: Element -> Event Bool Source #
Event that occurs when the user changes the checked status of an input element of type checkbox.
Standard DOM events
contextmenu :: Element -> Event (Double, Double) Source #
Context menu event.
The mouse coordinates are relative to the upper left corner of the element.
mousemove :: Element -> Event (Double, Double) Source #
Event that periodically occurs while the mouse is moving over an element.
The event value represents the mouse coordinates relative to the upper left corner of the element.
Note: The body element responds to mouse move events,
but only in the area occupied by actual content,
not the whole browser window.
mousedown :: Element -> Event (Double, Double) Source #
Mouse down event.
The mouse coordinates are relative to the upper left corner of the element.
mouseup :: Element -> Event (Double, Double) Source #
Mouse up event.
The mouse coordinates are relative to the upper left corner of the element.
keydown :: Element -> Event KeyCode Source #
Key pressed while element has focus. Returns the keycode (as opposed to the ASCII value) of any key, including SHIFT, CTRL and arrow keys.
keypress :: Element -> Event Char Source #
Key pressed while element has focus. Returns the actual character, taking into account SHIFT or CAPS LOCK.
Migration
roundCoordinates :: (Double, Double) -> (Int, Int) Source #
Round a pair of Double to the next integers.
This function helps you migrate from previous versions of Threepenny-GUI.
The return types of mouse events (mousedown, mouseup, mousemove, contextmenu)
have been redefined from long
to double in the CSS Object Model View Model working draft,
which browsers have begun to adopt.
See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent#Specifications
and https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/pageX