From 662a75d23397540fe5798104a845581838afd91f Mon Sep 17 00:00:00 2001 From: starnakin Date: Sun, 8 Sep 2024 19:56:34 +0200 Subject: [PATCH] fix: capslock support uggly code to fix bug uwu --- src/terminal/get.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/terminal/get.c b/src/terminal/get.c index ddba96f..f37250e 100644 --- a/src/terminal/get.c +++ b/src/terminal/get.c @@ -12,9 +12,11 @@ uint8_t terminal_getkey(void) uint8_t scan_code; scan_code = inb(KEYBOARD_PORT); - if (scan_code == KEY_RIGHT_SHIFT || scan_code == KET_LEFT_SHIFT) // || scan_code == KEY_CAPSLOCK) + if (scan_code == 0x3A || scan_code == 0x58) + caps = !caps; + else if (scan_code == KEY_RIGHT_SHIFT || scan_code == KET_LEFT_SHIFT) caps = true; - else if (scan_code == KEY_RIGHT_SHIFT + 128 || scan_code == KET_LEFT_SHIFT + 128) // || scan_code == KEY_CAPSLOCK + 128) + else if (scan_code == KEY_RIGHT_SHIFT + 128 || scan_code == KET_LEFT_SHIFT + 128) caps = false; else if (scan_code != prev_scan_code && prev_scan_code != 0) { if (scan_code < 128 && keymap[scan_code])