threepenny-gui-0.8.2.4: GUI framework that uses the web browser as a display.

Safe HaskellNone
LanguageHaskell98

Graphics.UI.Threepenny.Events

Contents

Synopsis

Synopsis

Events on DOM elements.

Convenience events

valueChange :: Element -> Event String #

Event that occurs when the user changes the value of the input element.

selectionChange :: Element -> Event (Maybe Int) #

Event that occurs when the user changes the selection of a select element.

checkedChange :: Element -> Event Bool #

Event that occurs when the user changes the checked status of an input element of type checkbox.

Standard DOM events

click :: Element -> Event () #

Mouse click.

contextmenu :: Element -> Event (Int, Int) #

Context menu event.

mousemove :: Element -> Event (Int, Int) #

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 (Int, Int) #

Mouse down event. The mouse coordinates are relative to the element.

mouseup :: Element -> Event (Int, Int) #

Mouse up event. The mouse coordinates are relative to the element.

hover :: Element -> Event () #

Mouse enters an element.

leave :: Element -> Event () #

Mouse leaving an element.

focus :: Element -> Event () #

Element receives focus.

blur :: Element -> Event () #

Element loses focus.

type KeyCode = Int #

keyup :: Element -> Event KeyCode #

Key released while element has focus.

keydown :: Element -> Event KeyCode #

Key pressed while element has focus. Returns the keycode (as opposed to the ASCII value) of any key, including SHIFT, CTRL and arrow keys.