ingnore invalid scancodes
This commit is contained in:
@@ -112,15 +112,15 @@ bool fetch(Key &pressed) {
|
||||
uint8_t status_reg = ctrl_port.inb();
|
||||
if(status_reg & IS_MOUSE || !(status_reg & HAS_OUTPUT) )
|
||||
return false; // TODO Remove mouse events from buffer
|
||||
DBG_VERBOSE << "status: " << hex << static_cast<int>(status_reg) << "\n" << flush;
|
||||
|
||||
uint8_t out_buffer = data_port.inb();
|
||||
DBG_VERBOSE << "scancode: " << hex << static_cast<int>(out_buffer) << "\n" << flush;
|
||||
|
||||
pressed = key_decoder.decode(out_buffer);
|
||||
|
||||
|
||||
if (pressed.alt() || pressed.ctrl() || pressed.shift) {
|
||||
if (pressed.alt() || pressed.ctrl() || pressed.shift || !pressed.valid())
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user