Skip to main content

Module touch_buttons

Module touch_buttons 

Source
Expand description

Touch→button emulation for the CoreS3 (FT6336U).

The CoreS3 has no physical front-panel buttons; a strip of the touch panel is split into three zones emulating the classic M5Stack Left/Center/Right buttons. A small state machine detects short taps (with multi-tap counting) and long presses and emits the same ButtonEvent as the Fire27’s physical buttons (crate::io::buttons), so the application maps input events in one place for both boards.

Each contact is judged as one stroke, finger down to finger up, by where it started and whether it stayed put. A stroke that travels more than TouchButtonsConfig::tap_slop_px is a swipe and emits nothing: a drag that merely crossed the strip used to fire the key it crossed. Above the strip, two still taps in quick succession are a TouchInput::DoubleTap (TouchButtons::next_input).

Structs§

TouchButtons
The emulated three-button strip. Construct once, then await next_event in a loop.
TouchButtonsConfig

Enums§

TouchInput
Everything the touch panel can mean: a key, or a double tap above the strip.