Kernel: Support volume keys from USB consumer page
This commit is contained in:
@@ -253,8 +253,9 @@ namespace Kernel
|
||||
BAN::Vector<USBHID::Report> outputs;
|
||||
TRY(gather_collection_reports(collection, outputs, USBHID::Report::Type::Output));
|
||||
|
||||
if (collection.usage_page == 0x01)
|
||||
switch (collection.usage_page)
|
||||
{
|
||||
case 0x01:
|
||||
switch (collection.usage_id)
|
||||
{
|
||||
case 0x02:
|
||||
@@ -273,6 +274,15 @@ namespace Kernel
|
||||
dwarnln("Unsupported generic descript page usage 0x{2H}", collection.usage_id);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x0C:
|
||||
switch (collection.usage_id)
|
||||
{
|
||||
case 0x01:
|
||||
report.device = TRY(BAN::RefPtr<USBKeyboard>::create(*this, BAN::move(outputs)));
|
||||
dprintln("Initialized an USB Consumer Control");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TRY(result.push_back(BAN::move(report)));
|
||||
|
||||
@@ -135,15 +135,33 @@ namespace Kernel
|
||||
|
||||
ASSERT(m_keyboard_lock.current_processor_has_lock());
|
||||
|
||||
if (usage_page != 0x07)
|
||||
if (state == 0)
|
||||
return;
|
||||
|
||||
switch (usage_page)
|
||||
{
|
||||
dprintln_if(DEBUG_USB_KEYBOARD, "Unsupported keyboard usage page {2H}", usage_page);
|
||||
return;
|
||||
case 0x07:
|
||||
if (usage >= 4 && usage < m_keyboard_state_temp.size())
|
||||
m_keyboard_state_temp[usage] = true;
|
||||
break;
|
||||
case 0x0C:
|
||||
switch (usage)
|
||||
{
|
||||
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;
|
||||
}
|
||||
if (!state)
|
||||
return;
|
||||
if (usage >= 4 && usage < m_keyboard_state_temp.size())
|
||||
m_keyboard_state_temp[usage] = state;
|
||||
}
|
||||
|
||||
void USBKeyboard::update()
|
||||
|
||||
Reference in New Issue
Block a user