m3e/swipe_gesture
SwipeGesture is a non-visual element used to detect and interpret swipe gestures from an input stream //// produced from an attached element.
This file was generated by m3e/generator
DO NOT EDIT
Types
Config is a public record for configuring this component.
pub type Config {
Config(
for: option.Option(String),
buttons: List(gesture_input_button.GestureInputButton),
pointer_types: List(pointer_type.PointerType),
disabled: Disabled,
priority: String,
pointers: Float,
start_threshold: Float,
min_displacement: Float,
min_velocity: String,
direction_threshold: String,
direction_grace_period: Float,
directions: List(
swipe_gesture_direction.SwipeGestureDirection,
),
max_press_interval: Float,
)
}
Constructors
-
Config( for: option.Option(String), buttons: List(gesture_input_button.GestureInputButton), pointer_types: List(pointer_type.PointerType), disabled: Disabled, priority: String, pointers: Float, start_threshold: Float, min_displacement: Float, min_velocity: String, direction_threshold: String, direction_grace_period: Float, directions: List(swipe_gesture_direction.SwipeGestureDirection), max_press_interval: Float, )
Disabled is whether gesture recognition is disabled.
pub type Disabled {
IsDisabled
IsNotDisabled
}
Constructors
-
IsDisabled -
IsNotDisabled
SwipeGesture is a View Model for this component
Fields:
- for: The identifier of the interactive control to which this element is attached.
- buttons: Which buttons can be pressed.
- pointer_types: Which types of pointers can be used to recognize gestures.
- disabled: Whether gesture recognition is disabled.
- priority: The priority in which to recognize gestures.
- pointers: Number of pointers required for the gesture to be recognized.
- start_threshold: Minimum distance (px) a pointer must move before the gesture starts.
- min_displacement: * Minimum distance (px) a pointer must move before the gesture can be recognized.
- min_velocity: Minimum velocity (px/ms) required before the gesture fails.
- direction_threshold: Minimum displacement (px) required before direction is considered valid.
- direction_grace_period: Maximum amount of time (ms) a pointer can move in an uncommitted or disallowed direction before the gesture is rejected. When set to 0, early‑direction rejection is disabled.
- directions: The allowed directions of the swipe.
- max_press_interval: Maximum allowed time (ms) between the earliest and latest press.
pub opaque type SwipeGesture
Values
pub fn buttons(
record: SwipeGesture,
buttons: List(gesture_input_button.GestureInputButton),
) -> SwipeGesture
buttons sets the value of buttons for this SwipeGesture.
pub const default_buttons: List(
gesture_input_button.GestureInputButton,
)
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_direction_grace_period: Float
pub const default_direction_threshold: String
pub const default_directions: List(
swipe_gesture_direction.SwipeGestureDirection,
)
pub const default_disabled: Disabled
pub const default_for: option.Option(String)
pub const default_max_press_interval: Float
pub const default_min_displacement: Float
pub const default_min_velocity: String
pub const default_pointer_types: List(pointer_type.PointerType)
pub const default_pointers: Float
pub const default_priority: String
pub const default_start_threshold: Float
pub fn direction_grace_period(
record: SwipeGesture,
direction_grace_period: Float,
) -> SwipeGesture
direction_grace_period sets the value of direction_grace_period for this SwipeGesture.
pub fn direction_threshold(
record: SwipeGesture,
direction_threshold: String,
) -> SwipeGesture
direction_threshold sets the value of direction_threshold for this SwipeGesture.
pub fn directions(
record: SwipeGesture,
directions: List(swipe_gesture_direction.SwipeGestureDirection),
) -> SwipeGesture
directions sets the value of directions for this SwipeGesture.
pub fn disabled(
record: SwipeGesture,
disabled: Disabled,
) -> SwipeGesture
disabled sets the value of disabled for this SwipeGesture.
pub fn for(
record: SwipeGesture,
for: option.Option(String),
) -> SwipeGesture
for sets the value of for for this SwipeGesture.
pub fn from_config(config: Config) -> SwipeGesture
from_config creates a new SwipeGesture from the given configuration.
pub fn max_press_interval(
record: SwipeGesture,
max_press_interval: Float,
) -> SwipeGesture
max_press_interval sets the value of max_press_interval for this SwipeGesture.
pub fn min_displacement(
record: SwipeGesture,
min_displacement: Float,
) -> SwipeGesture
min_displacement sets the value of min_displacement for this SwipeGesture.
pub fn min_velocity(
record: SwipeGesture,
min_velocity: String,
) -> SwipeGesture
min_velocity sets the value of min_velocity for this SwipeGesture.
pub fn pointer_types(
record: SwipeGesture,
pointer_types: List(pointer_type.PointerType),
) -> SwipeGesture
pointer_types sets the value of pointer_types for this SwipeGesture.
pub fn pointers(
record: SwipeGesture,
pointers: Float,
) -> SwipeGesture
pointers sets the value of pointers for this SwipeGesture.
pub fn priority(
record: SwipeGesture,
priority: String,
) -> SwipeGesture
priority sets the value of priority for this SwipeGesture.
pub fn render(
model: SwipeGesture,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render creates a Lustre Element for a SwipeGesture
pub fn render_config(
c: Config,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element from a SwipeGesture Config
pub fn start_threshold(
record: SwipeGesture,
start_threshold: Float,
) -> SwipeGesture
start_threshold sets the value of start_threshold for this SwipeGesture.