feat: switch text to UTF-8; add Unicode key events, dead keys & Czech layout; fix numpad navigation; add NumLock support

This commit is contained in:
daniel committed 2026-10-03 10:11:49 +02:00
1 parent 32660ddd1a
commit 2aa6360b3d
101 files changed
+3733 -1639

No files matched your search

+13 -3
View File
@@ -223,6 +223,12 @@ namespace Drivers::USB::HidKeyboard {
if (caps && base >= 'a' && base <= 'z') upper = !shift;
ascii = upper ? g_ScancodeToAsciiShifted[scancode] : base;
}
// Num Lock off: the keypad is navigation keys, which type nothing.
// (Only keypad usages get here with these scancodes: the dedicated
// navigation keys are nonChar already.)
if (!Drivers::PS2::Keyboard::GetNumLock() &&
Drivers::PS2::Keyboard::IsKeypadNavScancode(scancode))
ascii = 0;
Drivers::PS2::Keyboard::KeyEvent event = {
.Scancode = scancode,
@@ -367,10 +373,14 @@ namespace Drivers::USB::HidKeyboard {
uint8_t scancode = g_HidToScancode[key];
if (scancode != 0) {
InjectKey(scancode, true, modifiers, IsNonCharKey(key), IsExtendedKey(key));
g_RepeatKey = key;
g_RepeatStartMs = now;
g_LastRepeatMs = 0;
newKeyPressed = true;
// Lock keys toggle once per press; repeating them while
// held would flip Caps/Num/Scroll Lock on and off.
if (key != 0x39 && key != 0x53 && key != 0x47) {
g_RepeatKey = key;
g_RepeatStartMs = now;
g_LastRepeatMs = 0;
}
}
}
}