Add missing check for non-data items which lead to picking up some mice as
keyboards due to buttons being padded by non-data arrays. The keys wouldn't actually be used later, but a (useless) keyboard device would still be published. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35797 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -151,6 +151,9 @@ KeyboardDevice::AddHandler(HIDDevice *device, HIDReport *input)
|
||||
bool foundKeyboardUsage = false;
|
||||
for (uint32 i = 0; i < input->CountItems(); i++) {
|
||||
HIDReportItem *item = input->ItemAt(i);
|
||||
if (!item->HasData())
|
||||
continue;
|
||||
|
||||
if (item->UsagePage() == HID_USAGE_PAGE_KEYBOARD
|
||||
|| (item->UsagePage() == HID_USAGE_PAGE_CONSUMER && item->Array())
|
||||
|| (item->UsagePage() == HID_USAGE_PAGE_BUTTON && item->Array())) {
|
||||
|
||||
Reference in New Issue
Block a user