2d266b54a8
Replaced hardcoded US scancode→escape-sequence table in fbcond's text.rs with a configurable Keymap struct supporting TOML-based keyboard layouts. Five layouts embedded at compile time: - us.toml — US English (QWERTY), default - ru.toml — Russian JCUKEN, #1 non-English locale throughout Red Bear OS - uk.toml — UK English (QWERTY) - de.toml — German (QWERTZ) - fr.toml — French (AZERTY) Implementation: - src/keymap.rs: Keymap struct with TOML deserialization, scancode→byte sequence lookup, embedded defaults via include_str!(). 6 unit tests. - src/text.rs: TextScreen gains field. Hardcoded 12-arm scancode match replaced with call. Same Ctrl+letter translation fallback preserved. - keymaps/*.toml: Five embedded layout files. - Cargo.toml: added toml.workspace dependency. - main.rs: registered mod keymap. Keymap priority policy: English (US) default, Russian #1 non-English, then UK/DE/FR. Unknown names fall back to US.
18 lines
275 B
TOML
18 lines
275 B
TOML
[keymap]
|
|
name = "de"
|
|
description = "German (QWERTZ)"
|
|
|
|
[keys]
|
|
"0x0E" = "\x7F"
|
|
"0x1C" = "\n"
|
|
"0x47" = "\x1B[H"
|
|
"0x48" = "\x1B[A"
|
|
"0x49" = "\x1B[5~"
|
|
"0x4B" = "\x1B[D"
|
|
"0x4D" = "\x1B[C"
|
|
"0x4F" = "\x1B[F"
|
|
"0x50" = "\x1B[B"
|
|
"0x51" = "\x1B[6~"
|
|
"0x52" = "\x1B[2~"
|
|
"0x53" = "\x1B[3~"
|