From 712a34b021c0db93a8dba1224aec75722ace218c Mon Sep 17 00:00:00 2001 From: Estlin Howland Date: Wed, 27 May 2026 09:27:24 +1200 Subject: [PATCH 1/7] First Commit --- src/input/TCA8418Keyboard.cpp | 75 ++++++++++++++++++---------- variants/esp32s3/heltec_v4/variant.h | 3 ++ 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp index 238b9bb51df..25667e790ef 100644 --- a/src/input/TCA8418Keyboard.cpp +++ b/src/input/TCA8418Keyboard.cpp @@ -1,4 +1,5 @@ #include "TCA8418Keyboard.h" +#include "modules/CannedMessageModule.h" #define _TCA8418_COLS 3 #define _TCA8418_ROWS 4 @@ -10,36 +11,52 @@ using Key = TCA8418KeyboardBase::TCA8418Key; // Num chars per key, Modulus for rotating through characters -static uint8_t TCA8418TapMod[_TCA8418_NUM_KEYS] = {13, 7, 7, 7, 7, 7, 9, 7, 9, 2, 2, 2}; +static uint8_t TCA8418TapMod[_TCA8418_NUM_KEYS] = {13, 7, 7, 7, 7, 7, 9, 7, 9, 1, 2, 4}; static unsigned char TCA8418TapMap[_TCA8418_NUM_KEYS][13] = { {'1', '.', ',', '?', '!', ':', ';', '-', '_', '\\', '/', '(', ')'}, // 1 - {'2', 'a', 'b', 'c', 'A', 'B', 'C'}, // 2 - {'3', 'd', 'e', 'f', 'D', 'E', 'F'}, // 3 - {'4', 'g', 'h', 'i', 'G', 'H', 'I'}, // 4 - {'5', 'j', 'k', 'l', 'J', 'K', 'L'}, // 5 - {'6', 'm', 'n', 'o', 'M', 'N', 'O'}, // 6 - {'7', 'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S'}, // 7 - {'8', 't', 'u', 'v', 'T', 'U', 'V'}, // 8 - {'9', 'w', 'x', 'y', 'z', 'W', 'X', 'Y', 'Z'}, // 9 - {'*', '+'}, // * - {'0', ' '}, // 0 - {'#', '@'}, // # + {'a', 'b', 'c', '2', 'A', 'B', 'C'}, // 2 + {'d', 'e', 'f', '3', 'D', 'E', 'F'}, // 3 + {'g', 'h', 'i', '4', 'G', 'H', 'I'}, // 4 + {'j', 'k', 'l', '5', 'J', 'K', 'L'}, // 5 + {'m', 'n', 'o', '6', 'M', 'N', 'O'}, // 6 + {'p', 'q', 'r', 's', '7', 'P', 'Q', 'R', 'S'}, // 7 + {'t', 'u', 'v', '8', 'T', 'U', 'V'}, // 8 + {'w', 'x', 'y', 'z', '9', 'W', 'X', 'Y', 'Z'}, // 9 + {Key::BSP}, // * + {' ', '0'}, // 0 + {'#', '@', '*', '+'}, // # }; static unsigned char TCA8418LongPressMap[_TCA8418_NUM_KEYS] = { Key::ESC, // 1 Key::UP, // 2 - Key::NONE, // 3 + Key::TAB, // 3 Key::LEFT, // 4 - Key::NONE, // 5 + Key::SELECT, // 5 Key::RIGHT, // 6 Key::NONE, // 7 Key::DOWN, // 8 Key::NONE, // 9 Key::BSP, // * - Key::NONE, // 0 - Key::NONE, // # + Key::NONE, // 0 + Key::MUTE_TOGGLE // # +}; + +// key assignment when not in a free text entering state +static unsigned char TCA8418NavMap[_TCA8418_NUM_KEYS] = { + Key::ESC, // 1 + Key::UP, // 2 + Key::NONE, // 3 + Key::LEFT, // 4 + Key::SELECT, // 5 + Key::RIGHT, // 6 + Key::NONE, // 7 + Key::DOWN, // 8 + Key::NONE, // 9 + Key::BT_TOGGLE, // * + Key::GPS_TOGGLE, // 0 + Key::MUTE_TOGGLE // # }; TCA8418Keyboard::TCA8418Keyboard() @@ -110,19 +127,27 @@ void TCA8418Keyboard::released() state = Idle; return; } + uint32_t now = millis(); int32_t held_interval = now - last_tap; last_tap = now; - if (tap_interval < _TCA8418_MULTI_TAP_THRESHOLD && should_backspace) { - queueEvent(BSP); - } - if (held_interval > _TCA8418_LONG_PRESS_THRESHOLD) { - queueEvent(TCA8418LongPressMap[last_key]); - // LOG_DEBUG("Long Press Key: %i Map: %i", last_key, TCA8418LongPressMap[last_key]); + + + if (cannedMessageModule && cannedMessageModule->isCharInputAllowed()) { + if (tap_interval < _TCA8418_MULTI_TAP_THRESHOLD && should_backspace && TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])] != Key::BSP) { + queueEvent(BSP); + } + if (held_interval > _TCA8418_LONG_PRESS_THRESHOLD) { + queueEvent(TCA8418LongPressMap[last_key]); + // LOG_DEBUG("Long Press Key: %i Map: %i", last_key, TCA8418LongPressMap[last_key]); + } else { + queueEvent(TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); + // LOG_DEBUG("Key Press: %i Index:%i if %i Map: %c", last_key, char_idx, TCA8418TapMod[last_key], + // TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); + } } else { - queueEvent(TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); - // LOG_DEBUG("Key Press: %i Index:%i if %i Map: %c", last_key, char_idx, TCA8418TapMod[last_key], - // TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); + queueEvent(TCA8418NavMap[last_key]); + // LOG_DEBUG("Long Press Key: %i Map: %i", last_key, TCA8418LongPressMap[last_key]); } } diff --git a/variants/esp32s3/heltec_v4/variant.h b/variants/esp32s3/heltec_v4/variant.h index 72f55d09fa8..8a544897fbd 100644 --- a/variants/esp32s3/heltec_v4/variant.h +++ b/variants/esp32s3/heltec_v4/variant.h @@ -98,3 +98,6 @@ #define GPS_TX_PIN (38) // This is for bits going TOWARDS the CPU #define GPS_RX_PIN (39) // This is for bits going TOWARDS the GPS #define GPS_THREAD_INTERVAL 50 + +#define TCA8418_KB_ADDR 0x34 +#define HAS_PHYSICAL_KEYBOARD \ No newline at end of file From cc971d575dd992eb5248123e7575336d90846b26 Mon Sep 17 00:00:00 2001 From: Estlin Howland Date: Wed, 27 May 2026 19:01:15 +1200 Subject: [PATCH 2/7] added long press repeat for nav and backspace --- src/input/TCA8418Keyboard.cpp | 69 +++++++++++++++++++++++++++---- src/input/TCA8418Keyboard.h | 4 ++ src/input/TCA8418KeyboardBase.cpp | 42 ++++++++++++------- src/input/TCA8418KeyboardBase.h | 1 + 4 files changed, 91 insertions(+), 25 deletions(-) diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp index 25667e790ef..ba9616f0704 100644 --- a/src/input/TCA8418Keyboard.cpp +++ b/src/input/TCA8418Keyboard.cpp @@ -5,7 +5,8 @@ #define _TCA8418_ROWS 4 #define _TCA8418_NUM_KEYS 12 -#define _TCA8418_LONG_PRESS_THRESHOLD 2000 +#define _TCA8418_LONG_PRESS_THRESHOLD 1200 +#define _TCA8418_LONG_PRESS_REPEAT_INTERVAL 175 #define _TCA8418_MULTI_TAP_THRESHOLD 750 using Key = TCA8418KeyboardBase::TCA8418Key; @@ -40,7 +41,7 @@ static unsigned char TCA8418LongPressMap[_TCA8418_NUM_KEYS] = { Key::NONE, // 9 Key::BSP, // * Key::NONE, // 0 - Key::MUTE_TOGGLE // # + Key::NONE // # }; // key assignment when not in a free text entering state @@ -59,10 +60,29 @@ static unsigned char TCA8418NavMap[_TCA8418_NUM_KEYS] = { Key::MUTE_TOGGLE // # }; + +static bool isRepeatable(unsigned char key) +{ + return key == Key::UP || key == Key::DOWN || key == Key::LEFT || key == Key::RIGHT || key == Key::BSP; +} + +static unsigned char getDirectionalRepeatKey(uint8_t key_index, bool is_char_input_allowed) +{ + if (key_index >= _TCA8418_NUM_KEYS) { + return Key::NONE; + } + + unsigned char repeat_key = is_char_input_allowed ? TCA8418LongPressMap[key_index] : TCA8418NavMap[key_index]; + return isRepeatable(repeat_key) ? repeat_key : Key::NONE; +} + TCA8418Keyboard::TCA8418Keyboard() : TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), last_key(UINT8_MAX), next_key(UINT8_MAX), last_tap(0L), char_idx(0), - tap_interval(0), should_backspace(false) + tap_interval(0), should_backspace(false) { + press_started_at = 0; + last_repeat = 0; + is_repeating_long_press = false; } void TCA8418Keyboard::reset() @@ -114,6 +134,34 @@ void TCA8418Keyboard::pressed(uint8_t key) // Store the current key as the last key last_key = next_key; last_tap = now; + press_started_at = now; + last_repeat = now; + is_repeating_long_press = false; +} + +void TCA8418Keyboard::held() +{ + if (state != Held || last_key >= _TCA8418_NUM_KEYS) { + return; + } + + bool is_char_input_allowed = cannedMessageModule && cannedMessageModule->isCharInputAllowed(); + unsigned char repeat_key = getDirectionalRepeatKey(last_key, is_char_input_allowed); + if (repeat_key == Key::NONE) { + return; + } + + uint32_t now = millis(); + uint32_t held_interval = now - press_started_at; + if (held_interval <= _TCA8418_LONG_PRESS_THRESHOLD) { + return; + } + + if (!is_repeating_long_press || (now - last_repeat) >= _TCA8418_LONG_PRESS_REPEAT_INTERVAL) { + queueEvent(repeat_key); + is_repeating_long_press = true; + last_repeat = now; + } } void TCA8418Keyboard::released() @@ -129,26 +177,29 @@ void TCA8418Keyboard::released() } uint32_t now = millis(); - int32_t held_interval = now - last_tap; + int32_t held_interval = now - press_started_at; last_tap = now; - - if (cannedMessageModule && cannedMessageModule->isCharInputAllowed()) { + bool is_char_input_allowed = cannedMessageModule && cannedMessageModule->isCharInputAllowed(); + if (is_char_input_allowed) { if (tap_interval < _TCA8418_MULTI_TAP_THRESHOLD && should_backspace && TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])] != Key::BSP) { queueEvent(BSP); } if (held_interval > _TCA8418_LONG_PRESS_THRESHOLD) { - queueEvent(TCA8418LongPressMap[last_key]); - // LOG_DEBUG("Long Press Key: %i Map: %i", last_key, TCA8418LongPressMap[last_key]); + if (!is_repeating_long_press) { + queueEvent(TCA8418LongPressMap[last_key]); + // LOG_DEBUG("Long Press Key: %i Map: %i", last_key, TCA8418LongPressMap[last_key]); + } } else { queueEvent(TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); // LOG_DEBUG("Key Press: %i Index:%i if %i Map: %c", last_key, char_idx, TCA8418TapMod[last_key], // TCA8418TapMap[last_key][(char_idx % TCA8418TapMod[last_key])]); } - } else { + } else if (!is_repeating_long_press) { queueEvent(TCA8418NavMap[last_key]); // LOG_DEBUG("Long Press Key: %i Map: %i", last_key, TCA8418LongPressMap[last_key]); } + is_repeating_long_press = false; } void TCA8418Keyboard::setBacklight(bool on) diff --git a/src/input/TCA8418Keyboard.h b/src/input/TCA8418Keyboard.h index 0e882126015..68d1745f136 100644 --- a/src/input/TCA8418Keyboard.h +++ b/src/input/TCA8418Keyboard.h @@ -12,12 +12,16 @@ class TCA8418Keyboard : public TCA8418KeyboardBase protected: void pressed(uint8_t key) override; + void held(void) override; void released(void) override; uint8_t last_key; uint8_t next_key; uint32_t last_tap; + uint32_t press_started_at; + uint32_t last_repeat; uint8_t char_idx; int32_t tap_interval; bool should_backspace; + bool is_repeating_long_press; }; diff --git a/src/input/TCA8418KeyboardBase.cpp b/src/input/TCA8418KeyboardBase.cpp index 00aed99627c..9cb0114e850 100644 --- a/src/input/TCA8418KeyboardBase.cpp +++ b/src/input/TCA8418KeyboardBase.cpp @@ -148,26 +148,31 @@ char TCA8418KeyboardBase::dequeueEvent() void TCA8418KeyboardBase::trigger() { - if (keyCount() == 0) { + if (state == Init) { + reset(); return; } - if (state != Init) { - // Read the key register - uint8_t k = readRegister(TCA8418_REG_KEY_EVENT_A); - uint8_t key = k & 0x7F; - if (k & 0x80) { - if (state == Idle) - pressed(key); - return; - } else { - if (state == Held) { - released(); - } - state = Idle; - return; + + if (keyCount() == 0) { + if (state == Held) { + held(); } + return; + } + + // Read the key register + uint8_t k = readRegister(TCA8418_REG_KEY_EVENT_A); + uint8_t key = k & 0x7F; + if (k & 0x80) { + if (state == Idle) + pressed(key); + return; } else { - reset(); + if (state == Held) { + released(); + } + state = Idle; + return; } } @@ -177,6 +182,11 @@ void TCA8418KeyboardBase::pressed(uint8_t key) LOG_ERROR("pressed() not implemented in derived class"); } +void TCA8418KeyboardBase::held() +{ + // optional in derived class +} + void TCA8418KeyboardBase::released() { // must be defined in derived class diff --git a/src/input/TCA8418KeyboardBase.h b/src/input/TCA8418KeyboardBase.h index e608c6da543..7a6965587a4 100644 --- a/src/input/TCA8418KeyboardBase.h +++ b/src/input/TCA8418KeyboardBase.h @@ -128,6 +128,7 @@ class TCA8418KeyboardBase }; virtual void pressed(uint8_t key); + virtual void held(void); virtual void released(void); virtual void queueEvent(char); From 8fbc51502e1412f268c0b02bb06f9f2e3d2369ec Mon Sep 17 00:00:00 2001 From: Estlin Howland Date: Wed, 27 May 2026 21:46:42 +1200 Subject: [PATCH 3/7] ability to enter free text response without typing a char --- src/input/InputBroker.h | 1 + src/input/TCA8418Keyboard.cpp | 16 ++++++++-------- src/input/TCA8418KeyboardBase.h | 1 + src/input/kbI2cBase.cpp | 4 ++++ src/modules/CannedMessageModule.cpp | 8 ++++++++ 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/input/InputBroker.h b/src/input/InputBroker.h index 975c9d9f4a2..6985739fba2 100644 --- a/src/input/InputBroker.h +++ b/src/input/InputBroker.h @@ -47,6 +47,7 @@ enum input_broker_event { #define INPUT_BROKER_MSG_FN_SYMBOL_OFF 0xf2 #define INPUT_BROKER_MSG_BLUETOOTH_TOGGLE 0xAA #define INPUT_BROKER_MSG_TAB 0x09 +#define INPUT_BROKER_MSG_OPEN_FREETEXT 0x8E #define INPUT_BROKER_MSG_EMOTE_LIST 0x8F typedef struct _InputEvent { diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp index ba9616f0704..46b26cff395 100644 --- a/src/input/TCA8418Keyboard.cpp +++ b/src/input/TCA8418Keyboard.cpp @@ -5,8 +5,8 @@ #define _TCA8418_ROWS 4 #define _TCA8418_NUM_KEYS 12 -#define _TCA8418_LONG_PRESS_THRESHOLD 1200 -#define _TCA8418_LONG_PRESS_REPEAT_INTERVAL 175 +#define _TCA8418_LONG_PRESS_THRESHOLD 1000 +#define _TCA8418_LONG_PRESS_REPEAT_INTERVAL 125 #define _TCA8418_MULTI_TAP_THRESHOLD 750 using Key = TCA8418KeyboardBase::TCA8418Key; @@ -15,7 +15,7 @@ using Key = TCA8418KeyboardBase::TCA8418Key; static uint8_t TCA8418TapMod[_TCA8418_NUM_KEYS] = {13, 7, 7, 7, 7, 7, 9, 7, 9, 1, 2, 4}; static unsigned char TCA8418TapMap[_TCA8418_NUM_KEYS][13] = { - {'1', '.', ',', '?', '!', ':', ';', '-', '_', '\\', '/', '(', ')'}, // 1 + {'.', ',', '?', '!', '1', ':', ';', '-', '_', '\\', '/', '(', ')'}, // 1 {'a', 'b', 'c', '2', 'A', 'B', 'C'}, // 2 {'d', 'e', 'f', '3', 'D', 'E', 'F'}, // 3 {'g', 'h', 'i', '4', 'G', 'H', 'I'}, // 4 @@ -48,7 +48,7 @@ static unsigned char TCA8418LongPressMap[_TCA8418_NUM_KEYS] = { static unsigned char TCA8418NavMap[_TCA8418_NUM_KEYS] = { Key::ESC, // 1 Key::UP, // 2 - Key::NONE, // 3 + Key::OPEN_FREETEXT, // 3 Key::LEFT, // 4 Key::SELECT, // 5 Key::RIGHT, // 6 @@ -61,18 +61,18 @@ static unsigned char TCA8418NavMap[_TCA8418_NUM_KEYS] = { }; -static bool isRepeatable(unsigned char key) +static bool isRepeatable(Key key) { return key == Key::UP || key == Key::DOWN || key == Key::LEFT || key == Key::RIGHT || key == Key::BSP; } -static unsigned char getDirectionalRepeatKey(uint8_t key_index, bool is_char_input_allowed) +static Key getRepeatKey(uint8_t key_index, bool is_char_input_allowed) { if (key_index >= _TCA8418_NUM_KEYS) { return Key::NONE; } - unsigned char repeat_key = is_char_input_allowed ? TCA8418LongPressMap[key_index] : TCA8418NavMap[key_index]; + Key repeat_key = static_cast(is_char_input_allowed ? TCA8418LongPressMap[key_index] : TCA8418NavMap[key_index]); return isRepeatable(repeat_key) ? repeat_key : Key::NONE; } @@ -146,7 +146,7 @@ void TCA8418Keyboard::held() } bool is_char_input_allowed = cannedMessageModule && cannedMessageModule->isCharInputAllowed(); - unsigned char repeat_key = getDirectionalRepeatKey(last_key, is_char_input_allowed); + unsigned char repeat_key = getRepeatKey(last_key, is_char_input_allowed); if (repeat_key == Key::NONE) { return; } diff --git a/src/input/TCA8418KeyboardBase.h b/src/input/TCA8418KeyboardBase.h index 7a6965587a4..9356ec25c83 100644 --- a/src/input/TCA8418KeyboardBase.h +++ b/src/input/TCA8418KeyboardBase.h @@ -27,6 +27,7 @@ class TCA8418KeyboardBase MUTE_TOGGLE = 0xAC, SEND_PING = 0xAF, BL_TOGGLE = 0xAB, + OPEN_FREETEXT = 0x8E, FUNCTION_F1 = 0xF1, FUNCTION_F2 = 0xF2, FUNCTION_F3 = 0xF3, diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 510fb1e31df..9b42a7b20ea 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -325,6 +325,10 @@ int32_t KbI2cBase::runOnce() e.inputEvent = INPUT_BROKER_ANYKEY; e.kbchar = INPUT_BROKER_MSG_TAB; break; + case TCA8418KeyboardBase::OPEN_FREETEXT: + e.inputEvent = INPUT_BROKER_ANYKEY; + e.kbchar = INPUT_BROKER_MSG_OPEN_FREETEXT; + break; case TCA8418KeyboardBase::FUNCTION_F1: e.inputEvent = INPUT_BROKER_FN_F1; e.kbchar = 0x00; diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index a29b9fa5838..7793b3e0848 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -451,6 +451,14 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) LaunchWithDestination(NODENUM_BROADCAST); return 1; } + // Allow opening free text compose without printing a char + if (event->kbchar == INPUT_BROKER_MSG_OPEN_FREETEXT) { + updateState(CANNED_MESSAGE_RUN_STATE_FREETEXT, true); + UIFrameEvent e; + e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; + notifyObservers(&e); + return 1; + } // Printable char (ASCII) opens free text compose if (event->kbchar >= 32 && event->kbchar <= 126) { updateState(CANNED_MESSAGE_RUN_STATE_FREETEXT, true); From 18b6b7220df76c062753efd71c11f30b5f5f5baf Mon Sep 17 00:00:00 2001 From: Estlin Howland Date: Wed, 27 May 2026 22:17:33 +1200 Subject: [PATCH 4/7] opening free text defaults to last viewed message context --- src/modules/CannedMessageModule.cpp | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 7793b3e0848..da5efb41a44 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -59,6 +59,31 @@ static NodeNum lastDest = NODENUM_BROADCAST; static uint8_t lastChannel = 0; static bool lastDestSet = false; +static void applyComposeContextFromCurrentThread(NodeNum &dest, uint8_t &channel) +{ + switch (graphics::MessageRenderer::getThreadMode()) { + case graphics::MessageRenderer::ThreadMode::DIRECT: { + const uint32_t peer = graphics::MessageRenderer::getThreadPeer(); + if (peer != 0) { + dest = peer; + channel = 0; + } + break; + } + case graphics::MessageRenderer::ThreadMode::CHANNEL: { + const int threadChannel = graphics::MessageRenderer::getThreadChannel(); + if (threadChannel >= 0 && threadChannel < channels.getNumChannels()) { + dest = NODENUM_BROADCAST; + channel = static_cast(threadChannel); + } + break; + } + case graphics::MessageRenderer::ThreadMode::ALL: + default: + break; + } +} + meshtastic_CannedMessageModuleConfig cannedMessageModuleConfig; CannedMessageModule *cannedMessageModule; @@ -453,6 +478,10 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) } // Allow opening free text compose without printing a char if (event->kbchar == INPUT_BROKER_MSG_OPEN_FREETEXT) { + applyComposeContextFromCurrentThread(dest, channel); + lastDest = dest; + lastChannel = channel; + lastDestSet = true; updateState(CANNED_MESSAGE_RUN_STATE_FREETEXT, true); UIFrameEvent e; e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; @@ -461,6 +490,10 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) } // Printable char (ASCII) opens free text compose if (event->kbchar >= 32 && event->kbchar <= 126) { + applyComposeContextFromCurrentThread(dest, channel); + lastDest = dest; + lastChannel = channel; + lastDestSet = true; updateState(CANNED_MESSAGE_RUN_STATE_FREETEXT, true); UIFrameEvent e; e.action = UIFrameEvent::Action::REGENERATE_FRAMESET; From 2752af850adf6b1d23a746cbfd8f2ba5c955b600 Mon Sep 17 00:00:00 2001 From: Estlin Howland Date: Wed, 27 May 2026 22:39:19 +1200 Subject: [PATCH 5/7] remove bt toggle, quite annoying to hit on accident --- src/input/TCA8418Keyboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp index 46b26cff395..3cebe08b4c2 100644 --- a/src/input/TCA8418Keyboard.cpp +++ b/src/input/TCA8418Keyboard.cpp @@ -55,7 +55,7 @@ static unsigned char TCA8418NavMap[_TCA8418_NUM_KEYS] = { Key::NONE, // 7 Key::DOWN, // 8 Key::NONE, // 9 - Key::BT_TOGGLE, // * + Key::NONE, // * Key::GPS_TOGGLE, // 0 Key::MUTE_TOGGLE // # }; From 94876b574d6222f272d23a1820273eef4514cde8 Mon Sep 17 00:00:00 2001 From: Estlin Howland Date: Thu, 28 May 2026 10:45:34 +1200 Subject: [PATCH 6/7] not needed --- variants/esp32s3/heltec_v4/variant.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/variants/esp32s3/heltec_v4/variant.h b/variants/esp32s3/heltec_v4/variant.h index 8a544897fbd..cd3db8edacb 100644 --- a/variants/esp32s3/heltec_v4/variant.h +++ b/variants/esp32s3/heltec_v4/variant.h @@ -97,7 +97,4 @@ // Seems to be missing on this new board #define GPS_TX_PIN (38) // This is for bits going TOWARDS the CPU #define GPS_RX_PIN (39) // This is for bits going TOWARDS the GPS -#define GPS_THREAD_INTERVAL 50 - -#define TCA8418_KB_ADDR 0x34 -#define HAS_PHYSICAL_KEYBOARD \ No newline at end of file +#define GPS_THREAD_INTERVAL 50 \ No newline at end of file From 62de276b489b07674280a6ca75bc34c3da43bc35 Mon Sep 17 00:00:00 2001 From: Estlin Howland Date: Thu, 28 May 2026 20:57:20 +1200 Subject: [PATCH 7/7] 250ms tests as a nice repeat rate, though currently limited by the i2c polling rate of 300ms --- src/input/TCA8418Keyboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/TCA8418Keyboard.cpp b/src/input/TCA8418Keyboard.cpp index 3cebe08b4c2..3b00781cd9e 100644 --- a/src/input/TCA8418Keyboard.cpp +++ b/src/input/TCA8418Keyboard.cpp @@ -6,7 +6,7 @@ #define _TCA8418_NUM_KEYS 12 #define _TCA8418_LONG_PRESS_THRESHOLD 1000 -#define _TCA8418_LONG_PRESS_REPEAT_INTERVAL 125 +#define _TCA8418_LONG_PRESS_REPEAT_INTERVAL 250 #define _TCA8418_MULTI_TAP_THRESHOLD 750 using Key = TCA8418KeyboardBase::TCA8418Key;