lustre/event
Functions
pub fn checked(event: Dynamic) -> Result(Bool, List(DecodeError))
A helpful decoder to extract the checked
property from an event triggered
by a checkbox.
pub fn mouse_position(event: Dynamic) -> Result(
#(Float, Float),
List(DecodeError),
)
A helpful decoder to grab the mouse’s current x and y position in the viewport from an event object.
pub fn on_keydown(msg: fn(String) -> a) -> Attribute(a)
Listens for key dow events on an element, and dispatches a message with the current key being pressed.
pub fn on_keypress(msg: fn(String) -> a) -> Attribute(a)
Listens for key presses on an element, and dispatches a message with the current key being pressed.
pub fn on_keyup(msg: fn(String) -> a) -> Attribute(a)
Listens for key up events on an element, and dispatches a message with the current key being released.
pub fn on_mouse_down(msg: a) -> Attribute(a)
pub fn on_mouse_enter(msg: a) -> Attribute(a)
pub fn on_mouse_leave(msg: a) -> Attribute(a)
pub fn on_mouse_out(msg: a) -> Attribute(a)
pub fn on_mouse_over(msg: a) -> Attribute(a)
pub fn on_mouse_up(msg: a) -> Attribute(a)