sprocket/html/events
Types
pub type KeyEvent {
KeyEvent(
key: String,
code: String,
ctrl_key: Bool,
shift_key: Bool,
alt_key: Bool,
meta_key: Bool,
)
}
Constructors
-
KeyEvent( key: String, code: String, ctrl_key: Bool, shift_key: Bool, alt_key: Bool, meta_key: Bool, )
pub type MouseEvent {
MouseEvent(
x: Int,
y: Int,
ctrl_key: Bool,
shift_key: Bool,
alt_key: Bool,
meta_key: Bool,
)
}
Constructors
-
MouseEvent( x: Int, y: Int, ctrl_key: Bool, shift_key: Bool, alt_key: Bool, meta_key: Bool, )
Functions
pub fn decode_form_data(
event: Dynamic,
) -> Result(Dict(String, String), List(DecodeError))
Decode the form data from a form submit event.
pub fn decode_key_event(
event: Dynamic,
) -> Result(KeyEvent, List(DecodeError))
pub fn decode_keypress(
event: Dynamic,
) -> Result(String, List(DecodeError))
Decode the key from a key press event.
pub fn decode_mouse_event(
event: Dynamic,
) -> Result(MouseEvent, List(DecodeError))
Decode a mouse event that includes position clientX
and clientY
and modifier keys.
pub fn decode_target_checked(
event: Dynamic,
) -> Result(Bool, List(DecodeError))
pub fn decode_target_value(
event: Dynamic,
) -> Result(String, List(DecodeError))
Decode the value from an event event.target.value
.
pub fn on_dblclick(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_dragend(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_dragenter(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_dragleave(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_dragover(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_dragstart(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_focusin(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_focusout(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_keydown(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_mousedown(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_mouseenter(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_mouseleave(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_mousemove(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_mouseout(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_mouseover(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_mouseup(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_touchcancel(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_touchend(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_touchmove(cb: fn(Dynamic) -> Nil) -> Attribute
pub fn on_touchstart(cb: fn(Dynamic) -> Nil) -> Attribute