Kernel: Deduplicate USB keyboard input code
This commit is contained in:
@@ -148,40 +148,10 @@ namespace Kernel
|
|||||||
{
|
{
|
||||||
(void)min; (void)max;
|
(void)min; (void)max;
|
||||||
|
|
||||||
ASSERT(m_keyboard_lock.current_processor_has_lock());
|
|
||||||
|
|
||||||
if (state == 0)
|
if (state == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (usage_page)
|
handle_array(usage_page, usage);
|
||||||
{
|
|
||||||
case 0x07:
|
|
||||||
if (usage >= 4 && usage < m_keyboard_state_temp.size())
|
|
||||||
m_keyboard_state_temp[usage] = true;
|
|
||||||
break;
|
|
||||||
case 0x0C:
|
|
||||||
switch (usage)
|
|
||||||
{
|
|
||||||
case 0x00:
|
|
||||||
break;
|
|
||||||
case 0xE2:
|
|
||||||
m_keyboard_state_temp[0x7F] = true;
|
|
||||||
break;
|
|
||||||
case 0xE9:
|
|
||||||
m_keyboard_state_temp[0x80] = true;
|
|
||||||
break;
|
|
||||||
case 0xEA:
|
|
||||||
m_keyboard_state_temp[0x81] = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dprintln_if(DEBUG_USB_KEYBOARD, "Unsupported consumer page usage {2H}", usage);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dprintln_if(DEBUG_USB_KEYBOARD, "Unsupported keyboard usage page {2H}", usage_page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void USBKeyboard::update()
|
void USBKeyboard::update()
|
||||||
|
|||||||
Reference in New Issue
Block a user