Fix nonfunctional backslash key

This commit is contained in:
pjht 2024-09-11 15:18:02 -05:00
parent 70c8ea2da5
commit 1659c934ac
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -4,7 +4,7 @@ use std::{collections::VecDeque, os::mikros::{ipc, syscalls}, sync::OnceLock};
use controller::Ps2Controller;
use parking_lot::Mutex;
use pc_keyboard::{layouts::Us104Key, EventDecoder, HandleControl, ScancodeSet, ScancodeSet2};
use pc_keyboard::{layouts::Us104Key, EventDecoder, HandleControl, KeyCode, KeyEvent, ScancodeSet, ScancodeSet2};
static CONTROLLER: OnceLock<Ps2Controller> = OnceLock::new();
@ -73,6 +73,14 @@ fn process_keyboard_data() {
let Some(event) = scancode_decoder.advance_state(byte).unwrap() else {
continue;
};
let event = if event.code == KeyCode::Oem7 {
KeyEvent {
code: KeyCode::Oem5,
state: event.state,
}
} else {
event
};
let Some(key) = event_decoder.process_keyevent(event) else {
continue;
};