Author: mmlr Date: 2010-01-27 01:44:39 +0100 (Wed, 27 Jan 2010) New Revision: 35311 Changeset: http://dev.haiku-os.org/changeset/35311/haiku Modified: haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp Log: Also accept buttons from the "button page" as long as they are using arrays. That usually indicates keyboard-like usage and one of my keyboards uses this type for multimedia keys. Modified: haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp 2010-01-27 00:38:01 UTC (rev 35310) +++ haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/KeyboardDevice.cpp 2010-01-27 00:44:39 UTC (rev 35311) @@ -65,11 +65,12 @@ continue; if (item->UsagePage() == HID_USAGE_PAGE_KEYBOARD - || item->UsagePage() == HID_USAGE_PAGE_CONSUMER) { + || item->UsagePage() == HID_USAGE_PAGE_CONSUMER + || item->UsagePage() == HID_USAGE_PAGE_BUTTON) { TRACE("keyboard item with usage %lx\n", item->UsageMinimum()); if (item->Array()) { - // normal or "consumer" keys handled as array items + // normal or "consumer"/button keys handled as array items if (fKeyCount < MAX_KEYS) fKeys[fKeyCount++] = item; } else { @@ -81,11 +82,6 @@ fModifiers[fModifierCount++] = item; } } - } else if (item->UsagePage() == HID_USAGE_PAGE_CONSUMER) { - if (item->Array()) { - if (fKeyCount < MAX_KEYS) - fKeys[fKeyCount++] = item; - } } } @@ -162,9 +158,11 @@ HIDReportItem *item = input->ItemAt(j); if (item->UsagePage() == HID_USAGE_PAGE_KEYBOARD || (item->UsagePage() == HID_USAGE_PAGE_CONSUMER + && item->Array()) + || (item->UsagePage() == HID_USAGE_PAGE_BUTTON && item->Array())) { // found at least one item with a keyboard usage or with - // a consumer usage that is handled like a key + // a consumer/button usage that is handled like a key foundKeyboardUsage = true; break; } @@ -611,7 +609,7 @@ } if (key == 0) { - // unmapped normal key or consumer key + // unmapped normal key or consumer/button key key = fKeys[i]->UsageMinimum() + current[i]; }