mirror of
https://github.com/pelgraine/Meck.git
synced 2026-08-05 16:22:45 +02:00
Amended so sym plus $ prints the dollar sign now
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user