forked from Bananymous/banan-os
Kernel: Move keyboard kernel panic to the general input device
This will allow command to work without requiring it per keyboard driver
This commit is contained in:
parent
f49689caac
commit
02051ed60f
|
@ -107,6 +107,20 @@ namespace Kernel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_type == Type::Keyboard)
|
||||||
|
{
|
||||||
|
auto& key_event = event.as<const LibInput::RawKeyEvent>();
|
||||||
|
if (key_event.modifier & LibInput::KeyEvent::Modifier::Pressed)
|
||||||
|
{
|
||||||
|
switch (key_event.keycode)
|
||||||
|
{
|
||||||
|
case LibInput::keycode_function(12):
|
||||||
|
Kernel::panic("Keyboard kernel panic :)");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_event_count == m_max_event_count)
|
if (m_event_count == m_max_event_count)
|
||||||
{
|
{
|
||||||
m_event_tail = (m_event_tail + 1) % m_max_event_count;
|
m_event_tail = (m_event_tail + 1) % m_max_event_count;
|
||||||
|
|
|
@ -126,8 +126,6 @@ namespace Kernel::Input
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto dummy_event = LibInput::KeyboardLayout::get().key_event_from_raw(RawKeyEvent { .modifier = 0, .keycode = keycode.value() });
|
auto dummy_event = LibInput::KeyboardLayout::get().key_event_from_raw(RawKeyEvent { .modifier = 0, .keycode = keycode.value() });
|
||||||
if (dummy_event.key == Key::F1)
|
|
||||||
panic("OOF");
|
|
||||||
|
|
||||||
uint16_t modifier_mask = 0;
|
uint16_t modifier_mask = 0;
|
||||||
uint16_t toggle_mask = 0;
|
uint16_t toggle_mask = 0;
|
||||||
|
|
Loading…
Reference in New Issue