From eced4725894ec99cc1611044409059f58f62de4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Kala=C5=A1=20=28Floxen=29?= Date: Sun, 12 Jul 2026 12:27:56 +0200 Subject: [PATCH] =?UTF-8?q?P=C5=99id=C3=A1na=20podpora=20Caps=20Lock=20v?= =?UTF-8?q?=20kl=C3=A1vesnicov=C3=A9m=20ovlada=C4=8Di=20a=20p=C5=99evod=20?= =?UTF-8?q?p=C3=ADsmen=20na=20velk=C3=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/keyboard.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/keyboard.c b/drivers/keyboard.c index cbf6287..07320d5 100644 --- a/drivers/keyboard.c +++ b/drivers/keyboard.c @@ -21,6 +21,21 @@ static char g_history[KBD_HISTORY_MAX][KBD_HISTORY_LINE_MAX]; static int g_history_count = 0; static int g_history_head = 0; static int g_ctrl_down = 0; +static int g_shift_down = 0; + +static char apply_letter_case(char c) { + int upper = g_shift_down; + + if (!upper) { + return c; + } + + if (c >= 'a' && c <= 'z') { + return (char)(c - ('a' - 'A')); + } + + return c; +} static inline unsigned char inb(unsigned short port) { unsigned char ret; @@ -103,6 +118,16 @@ int keyboard_try_read_key(void) { return -1; } + if (sc == 0x2A || sc == 0x36) { + g_shift_down = 1; + return -1; + } + + if (sc == 0xAA || sc == 0xB6) { + g_shift_down = 0; + return -1; + } + if (sc & 0x80) { return -1; } @@ -123,7 +148,7 @@ int keyboard_try_read_key(void) { } if (sc < 128 && keymap[sc]) { - out = keymap[sc]; + out = apply_letter_case(keymap[sc]); return out; }