mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-07 04:36:11 +00:00
fix(ui): CardKB key handling - debounce, Fn modifier for submit/accents
CardKB is level-triggered (repeats the held byte every poll) and its Enter key collided with the on-screen keyboard grid's own commit action, causing duplicate characters and accidental message sends. Debounce polling and use the CardKB v1.1 Fn modifier (confirmed working on real hardware) instead of tracking navigation state: plain Enter now behaves like the physical centre button, Fn+Enter submits, Fn+Tab opens the Hold-Enter equivalent, and Fn+<letter> opens that letter's accent popup directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -200,7 +200,11 @@ class UITask : public AbstractUITask {
|
||||
// without that bus, or when nothing ACKs 0x5F at boot.
|
||||
#if defined(ENV_PIN_SDA) && defined(ENV_PIN_SCL)
|
||||
bool _has_cardkb = false;
|
||||
uint32_t _cardkb_poll_ms = 0;
|
||||
// CardKB is level-triggered, not edge-triggered -- it keeps returning the
|
||||
// same byte for as long as the physical key is held, not just once. Track
|
||||
// the last raw byte seen so a held key enqueues exactly one press instead
|
||||
// of one per poll tick.
|
||||
uint8_t _cardkb_last_raw = 0;
|
||||
#endif
|
||||
void pollCardKB();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user