Raxol.Animation.Gestures (Raxol v0.5.0)
View SourceGesture-driven interactions for Raxol animations.
This module provides a system for detecting and handling gestures in terminal UI, which can be used to trigger physics-based animations.
Supported gestures include:
- Swipe (rapid movement in a direction)
- Tap (quick press and release)
- Long press (press and hold)
- Drag (press, move, release)
- Pinch/zoom (simulated in terminal context)
- Multi-tap (multiple quick taps)
Summary
Functions
Gets the current state of all objects in active animations. This is used for rendering.
Initializes the gesture system.
Registers a handler for a specific gesture type.
Handles a touch/mouse down event.
Handles a touch/mouse move event.
Handles a touch/mouse up event.
Updates all active physics-based animations. Should be called on each frame.
Types
Functions
Gets the current state of all objects in active animations. This is used for rendering.
Initializes the gesture system.
Registers a handler for a specific gesture type.
Examples
iex> register_handler(:swipe, fn %{direction: :left} -> handle_left_swipe() end)
:ok
Handles a touch/mouse down event.
Handles a touch/mouse move event.
Handles a touch/mouse up event.
Updates all active physics-based animations. Should be called on each frame.