Commit message · rodericoinput: act on touch navbar release, and repeat prev/next while held
The touch navbar fired prev/select/next as soon as a touch was detected,
and relied on a fixed 100ms delay to avoid re-firing while the finger was
still down. A touch held for longer than that fired the action again,
which read as the touch panel being overly sensitive. The zone was also
re-evaluated on every poll, so a finger drifting during a touch triggered
whichever zone it happened to be over.
Handle the navbar like the physical buttons (navbtns.inc) instead: a touch
belongs to the zone it started in and acts once, on release. The finger
leaving the navbar or reaching another zone cancels the touch, so drifting
can't trigger a neighbouring action - in particular an unintended select.
Holding prev/next keeps auto-repeating, which things like the keyboard
rely on for fast scrolling, but now with the physical buttons' long-press
timings (CONFIG_BUTTON_LONG_PRESS_TIME_MS and
CONFIG_BUTTON_LONG_PRESS_HOLD_SERIAL_TIME_MS), measured with the tick
count rather than by counting polls. Once it has repeated, nothing more
fires on release. Select never repeats.
With CONFIG_DISPLAY_TOUCH_DIRECT, presses that start on the navbar are
still kept from the gui, and any other press still goes to it, even if
dragged onto the navbar. Whether a press started on the navbar is tracked
apart from its zone, as a cancelled navbar press no longer has a zone but
must still not reach the gui.
A failed touch read is skipped, as before, rather than taken as the finger
being lifted, which would act mid-press and then again on the real
release.
This affects every board using the touchscreen input: the Waveshare Touch
LCD 2 and 3.5, the M5Stack Core 2 and Core S3, and the TTGO T-Watch S3.
Tested on real Waveshare Touch LCD 2 hardware, with
CONFIG_DISPLAY_TOUCH_DIRECT on and off.
95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification