Skip to main content

Module input_device

Module input_device 

Source
Expand description

LPAR-04 §8 input-device adapters (Pointer, Keypad, Encoder, Button). LPAR-04 §8 input-device adapters.

Four thin typed wrappers that turn platform input into core [Event] streams plus the routing rules defined in LPAR-04 §8. They are adapters, not a driver framework — existing raw-event producers (PD/PM/PU/KD/ KU) remain valid without wrapping; this layer is additive.

§Device classes (LPAR-04 §8.1)

TypeProducesRouting rule
[PointerDevice]PointerDown/Move/Up, optionally TouchHit-test target (§6.2), canonical recognizer chain (§8.3)
[KeypadDevice]KeyDown/KeyUp, tick-driven auto-repeatFocused object as ObjectEvent::Key
[EncoderDevice]Encoder { diff }, Enter pressNavigate → focus movement; editing → ObjectEvent::Rotary/Key
[ButtonDevice]Synthesized PointerDown/Up at a configured screen pointIdentical to Pointer after synthesis

§Per-instance state

Two [PointerDevice]s do not share recognizer state (§8.4). Keypad and encoder devices address focus through the single-FOCUSED tree invariant (§7.3); multiple simultaneous keypad/encoder devices targeting different focus groups in one tree are out of v1 scope.

§Tick-domain durations

All durations are Tick counts (LPAR-04 §9.1). No wall-clock API appears anywhere in this module. Default constants are documented against LVGL’s nominal timings for a 30 Hz tick loop.

Structs§

ButtonDevice
LPAR-04 §8 Button input device adapter.
ButtonMapping
A hardware button mapped to a screen point.
EncoderDevice
LPAR-04 §8 Encoder input device adapter.
KeypadDevice
LPAR-04 §8 Keypad input device adapter with §9.7 tick-counted auto-repeat.
PointerDevice
LPAR-04 §8 Pointer input device adapter.

Constants§

KEY_REPEAT_DELAY_TICKS
Number of ticks a key must be held before auto-repeat begins.
KEY_REPEAT_PERIOD_TICKS
Number of ticks between successive auto-repeat deliveries after the initial repeat fires.