diff options
author | Marvin Borner | 2019-10-29 00:20:04 +0100 |
---|---|---|
committer | Marvin Borner | 2019-10-29 00:20:04 +0100 |
commit | 4f7484085c0074220ebf425da9f1cd202d4cbda1 (patch) | |
tree | 3956bc840139f48f993bcaa85cfa5476b47907a6 /src/kernel | |
parent | d2f6d3b5fe74f64953803c428f3220c97983706e (diff) |
Added caps lock key
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/input/ps2/keyboard.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/kernel/input/ps2/keyboard.c b/src/kernel/input/ps2/keyboard.c index 0fd97c9..87006b6 100644 --- a/src/kernel/input/ps2/keyboard.c +++ b/src/kernel/input/ps2/keyboard.c @@ -11,7 +11,7 @@ char keymap[128] = { '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 14 /*RS*/, '*', 0, // Alt key ' ', // Space bar - 0, // Caps lock + 15, // Caps lock 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // F keys 0, // Num lock 0, // Scroll lock @@ -41,7 +41,7 @@ char shift_keymap[128] = { '|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 14 /*RS*/, '*', 0, // Alt key ' ', // Space bar - 0, // Caps lock + 15, // Caps lock 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // F keys 0, // Num lock 0, // Scroll lock @@ -72,9 +72,13 @@ void keyboard_handler(struct regs *r) { scan_code = receive_b(0x60); if (!(scan_code & 0x80)) { // PRESS - if (current_keymap[scan_code] == 14) { + // TODO: Fix caps lock deactivation when pressing shift while shifted + if (current_keymap[scan_code] == 14 || (current_keymap[scan_code] == 15 && !shift_pressed)) { shift_pressed = 1; return; + } else if (current_keymap[scan_code] == 15 && shift_pressed) { + shift_pressed = 0; + return; } vesa_keyboard_char(current_keymap[scan_code]); } else if (scan_code & 0x80) { // RELEASE |