Skip to content

Commit be9e8a2

Browse files
3rdIterationclaude
andcommitted
feat: qwerty on-screen keyboards for devices with a physical keyboard
Add HAS_KEYBOARD config (selected by the T-Deck board) and lay out the on-screen keyboards qwerty to match the physical keys: the mnemonic word-entry keyboard and the upper/lower-case passphrase keyboards. The passphrase space key moves to the end of the middle row as qwerty needs all ten bottom-row columns for zxcvbnm plus the control keys. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b15b49f commit be9e8a2

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

main/Kconfig.projbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ menu "Blockstream Jade"
110110
config BOARD_TYPE_TDECK
111111
bool "LilyGO T-Deck (keyboard + trackball)"
112112
select HAS_BATTERY
113+
select HAS_KEYBOARD
113114
config BOARD_TYPE_TTGO_TWATCHS3
114115
bool "TTGO T-WATCH S3"
115116
select HAS_AXP
@@ -323,6 +324,12 @@ menu "Blockstream Jade"
323324
Enables USB JTAG serial rather than CDC tinyusb, implies no tinyusb/host storage/etc
324325
default n
325326

327+
config HAS_KEYBOARD
328+
bool "Device has a physical keyboard"
329+
help
330+
Device has a physical qwerty keyboard - on-screen keyboards
331+
are laid out qwerty to match
332+
326333
config HAS_BATTERY
327334
bool "Enable Battery Functions"
328335
help

main/ui/keyboard.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,27 @@ static void make_keyboard_screen(link_activity_t* kb_screen_activity, const char
4040
// NOTE: final three characters ('|', '>', 'S') are rendered in different symbols fonts
4141
// and are buttons for 'backspace', 'shift/next kb', and 'enter/done' (see below)
4242
if (kb_type == KB_LOWER_CASE_CHARS) {
43+
#ifdef CONFIG_HAS_KEYBOARD
44+
// Match the physical keyboard layout (space key ends the middle row)
45+
lines[0] = "qwertyuiop";
46+
lines[1] = "asdfghjkl ";
47+
lines[2] = "zxcvbnm|>S";
48+
#else
4349
lines[0] = "abcdefghij";
4450
lines[1] = "klmnopqrst";
4551
lines[2] = "uvwxyz |>S";
52+
#endif
4653
// 'sizes' ok
4754
} else if (kb_type == KB_UPPER_CASE_CHARS) {
55+
#ifdef CONFIG_HAS_KEYBOARD
56+
lines[0] = "QWERTYUIOP";
57+
lines[1] = "ASDFGHJKL ";
58+
lines[2] = "ZXCVBNM|>S";
59+
#else
4860
lines[0] = "ABCDEFGHIJ";
4961
lines[1] = "KLMNOPQRST";
5062
lines[2] = "UVWXYZ |>S";
63+
#endif
5164
// 'sizes' ok
5265
} else if (kb_type == KB_NUMBERS_SYMBOLS) {
5366
lines[0] = "1234567890";

main/ui/mnemonic.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,16 @@ gui_activity_t* make_enter_wordlist_word_activity(gui_view_node_t** titletext, c
290290

291291
// second row, keyboard
292292
char* lines[NUM_KEYBOARD_ROWS];
293+
#ifdef CONFIG_HAS_KEYBOARD
294+
// Match the physical keyboard layout
295+
lines[0] = (char[]){ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P' };
296+
lines[1] = (char[]){ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L' };
297+
lines[2] = (char[]){ 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ' ', '|' };
298+
#else
293299
lines[0] = (char[]){ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J' };
294300
lines[1] = (char[]){ 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S' };
295301
lines[2] = (char[]){ 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', '|' };
302+
#endif
296303
const size_t sizes[NUM_KEYBOARD_ROWS] = { 10, 9, 9 };
297304

298305
JADE_ASSERT(CONFIG_DISPLAY_WIDTH >= 240);

0 commit comments

Comments
 (0)