lustre_touch_events
Types
Touch type corresponding to: https://developer.mozilla.org/en-US/docs/Web/API/Touch
pub type Touch {
Touch(
identifier: Int,
screen_x: Float,
screen_y: Float,
client_x: Float,
client_y: Float,
page_x: Float,
page_y: Float,
radius_x: Float,
radius_y: Float,
rotation_angle: Float,
force: Float,
)
}
Constructors
-
Touch( identifier: Int, screen_x: Float, screen_y: Float, client_x: Float, client_y: Float, page_x: Float, page_y: Float, radius_x: Float, radius_y: Float, rotation_angle: Float, force: Float, )
Touch event corresponding to: https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent
pub type TouchEvent {
TouchEvent(
changed_touches: List(Touch),
target_touches: List(Touch),
touches: List(Touch),
rotation: Float,
scale: Float,
)
}
Constructors
-
TouchEvent( changed_touches: List(Touch), target_touches: List(Touch), touches: List(Touch), rotation: Float, scale: Float, )
Arguments
- rotation
-
rotation isn’t supported on all browsers and will default to: 0.0
- scale
-
scale isn’t supported on all browsers and will default to: 1.0
Functions
pub fn on_touch_cancel(msg: fn(TouchEvent) -> a) -> Attribute(a)
touchcancel
event:
https://developer.mozilla.org/en-US/docs/Web/API/Element/touchcancel_event
pub fn on_touch_end(msg: fn(TouchEvent) -> a) -> Attribute(a)
pub fn on_touch_move(msg: fn(TouchEvent) -> a) -> Attribute(a)
pub fn on_touch_start(msg: fn(TouchEvent) -> a) -> Attribute(a)