Amended so sym plus $ prints the dollar sign now

This commit is contained in:
pelgraine
2026-02-10 02:28:34 +11:00
parent a8675ceda9
commit b9a68f0f99
3 changed files with 14 additions and 7 deletions
+3 -3
View File
@@ -546,8 +546,8 @@ void handleKeyboardInput() {
return;
}
// '$' opens emoji picker
if (key == '$') {
// $ key opens emoji picker (Sym+$ types literal '$')
if (key == KB_KEY_EMOJI) {
emojiPicker.reset();
emojiPickerMode = true;
drawEmojiPicker();
@@ -846,7 +846,7 @@ void sendComposedMessage() {
uint32_t timestamp = rtc_clock.getCurrentTime();
// Convert escape bytes back to UTF-8 for mesh transmission and BLE app
// Worst case: each escape byte 8 bytes UTF-8 (flag emoji), plus ASCII chars
// Worst case: each escape byte → 8 bytes UTF-8 (flag emoji), plus ASCII chars
char utf8Buf[512];
emojiUnescape(composeBuffer, utf8Buf, sizeof(utf8Buf));
int utf8Len = strlen(utf8Buf);
@@ -103,7 +103,7 @@ struct EmojiPicker {
case '\r':
ensureVisible();
return (uint8_t)(EMOJI_ESCAPE_START + cursor);
case '\b': case 'q': case 'Q': case '$':
case '\b': case 'q': case 'Q': case KB_KEY_EMOJI:
return 0xFF;
default:
return 0;
+10 -3
View File
@@ -21,6 +21,7 @@
#define KB_KEY_BACKSPACE '\b'
#define KB_KEY_ENTER '\r'
#define KB_KEY_SPACE ' '
#define KB_KEY_EMOJI 0x01 // Internal code: bare $ key (emoji picker trigger)
class TCA8418Keyboard {
private:
@@ -225,10 +226,16 @@ public:
return 0;
}
// Handle dedicated $ key (key code 22, next to M)
// Handle $ key (key code 22, next to M)
// Bare press -> emoji picker trigger, Sym+$ -> literal '$' character
if (keyCode == 22) {
Serial.println("KB: $ key pressed");
return '$';
if (_symActive) {
_symActive = false;
Serial.println("KB: Sym+$ -> '$'");
return '$';
}
Serial.println("KB: $ key -> emoji trigger");
return KB_KEY_EMOJI;
}
// Handle Mic key - produces 0 with Sym, otherwise ignore