Ticket #7649: JProtocol.diff
File JProtocol.diff, 1.8 KB (added by , 12 years ago) |
---|
-
src/add-ons/kernel/drivers/input/usb_hid/HIDWriter.cpp
42 42 SetReportSize(bitLength); 43 43 SetReportCount(count); 44 44 45 main_item_data data ;45 main_item_data data = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 46 46 data.data_constant = 1; 47 47 return Input(data); 48 48 } -
src/add-ons/kernel/drivers/input/usb_hid/JoystickProtocolHandler.cpp
38 38 memset(&fJoystickModuleInfo, 0, sizeof(joystick_module_info)); 39 39 memset(&fCurrentValues, 0, sizeof(variable_joystick)); 40 40 41 // Make the first 2 axes reserved, usb_joy made the first 2 axes reserved 42 // this allows a legacy app to at least be able to use a gamepad 43 // With this modification i can use an xbox360 controller's first stick 44 // in a legacy application such as BeS9x. 45 46 fAxis = (HIDReportItem **)malloc(2 * sizeof(HIDReportItem *)); 47 fAxis[0] = report.FindItem(B_HID_USAGE_PAGE_GENERIC_DESKTOP, 48 B_HID_UID_GD_X); 49 fAxis[1] = report.FindItem(B_HID_USAGE_PAGE_GENERIC_DESKTOP, 50 B_HID_UID_GD_Y); 51 fAxisCount = 2; 52 41 53 for (uint32 i = 0; i < report.CountItems(); i++) { 42 54 HIDReportItem *item = report.ItemAt(i); 43 55 if (!item->HasData()) … … 89 101 } else 90 102 break; 91 103 104 if(item == fAxis[0] || item == fAxis[1]) 105 continue; 106 92 107 HIDReportItem **newAxis = (HIDReportItem **)realloc(fAxis, 93 108 ++fAxisCount * sizeof(HIDReportItem *)); 94 109 if (newAxis == NULL) {