Ticket #5136: usb_hid.patch
File usb_hid.patch, 2.0 KB (added by , 14 years ago) |
---|
-
src/add-ons/kernel/drivers/input/usb_hid/MouseDevice.cpp
10 10 #include "HIDDevice.h" 11 11 #include "HIDReport.h" 12 12 #include "HIDReportItem.h" 13 #include "HIDCollection.h" 13 14 14 15 #include <new> 15 16 #include <string.h> … … 55 56 { 56 57 HIDParser *parser = device->Parser(); 57 58 59 HIDCollection *rootCollection = parser->RootCollection(); 60 if (rootCollection == NULL) 61 return NULL; 62 63 uint32 usage = rootCollection->ExtendedUsage(); 64 if ((usage >> 16) != HID_USAGE_PAGE_GENERIC_DESKTOP) 65 return NULL; 66 if ((usage & 0xffff) != HID_USAGE_ID_MOUSE) 67 return NULL; 68 58 69 // try to find at least an x and y axis 59 70 HIDReport *report = NULL; 60 71 HIDReportItem *xAxis = NULL; -
src/add-ons/kernel/drivers/input/usb_hid/HIDParser.cpp
99 99 { 100 100 main_item_data *mainData = (main_item_data *)&data; 101 101 if (item->tag == ITEM_TAG_MAIN_COLLECTION) { 102 localState.usage_stack = usageStack; 103 localState.usage_stack_used = usageStackUsed; 104 102 105 HIDCollection *newCollection 103 106 = new(std::nothrow) HIDCollection(collection, 104 107 (uint8)data, globalState, localState); -
src/add-ons/kernel/drivers/input/usb_hid/HIDCollection.h
28 28 29 29 void PrintToStream(uint32 indentLevel = 0); 30 30 31 uint32 ExtendedUsage() { return fUsage; }; 32 31 33 private: 32 34 HIDCollection * fParent; 33 35