Changeset 47227 in vbox for trunk/src/VBox
- Timestamp:
- Jul 18, 2013 8:21:00 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/UsbMouse.cpp
r47219 r47227 39 39 #define USBHID_STR_ID_PRODUCT_M 2 40 40 #define USBHID_STR_ID_PRODUCT_T 3 41 #define USBHID_STR_ID_PRODUCT_MT 4 41 42 /** @} */ 42 43 … … 52 53 #define USBHID_PID_MOUSE 0x0020 53 54 #define USBHID_PID_TABLET 0x0021 55 #define USBHID_PID_MULTI_TOUCH 0x0022 54 56 /** @} */ 55 57 … … 133 135 struct 134 136 { 135 uint32_t fButtons;136 137 uint32_t x; 137 138 uint32_t y; 138 int32_t dz;139 uint32_t fButtons; 139 140 } Absolute; 140 141 struct … … 231 232 typedef struct USBHIDT_REPORT 232 233 { 233 uint8_t rid;234 uint8_t fButtons;235 int8_t dz;236 int8_t dummy;237 234 uint16_t x; 238 235 uint16_t y; 236 uint8_t fButtons; 239 237 } USBHIDT_REPORT, *PUSBHIDT_REPORT; 240 238 … … 268 266 static const PDMUSBDESCCACHESTRING g_aUsbHidStrings_en_US[] = 269 267 { 270 { USBHID_STR_ID_MANUFACTURER, "VirtualBox" }, 271 { USBHID_STR_ID_PRODUCT_M, "USB Mouse" }, 272 { USBHID_STR_ID_PRODUCT_T, "USB Tablet" }, 268 { USBHID_STR_ID_MANUFACTURER, "VirtualBox" }, 269 { USBHID_STR_ID_PRODUCT_M, "USB Mouse" }, 270 { USBHID_STR_ID_PRODUCT_T, "USB Tablet" }, 271 { USBHID_STR_ID_PRODUCT_MT, "USB Multi-Touch" }, 273 272 }; 274 273 … … 359 358 /* Usage */ 0x09, 0x02, /* Mouse */ 360 359 /* Collection */ 0xA1, 0x01, /* Application */ 361 /* Report ID */ 0x85, REPORTID_MOUSE,362 360 /* Usage */ 0x09, 0x01, /* Pointer */ 363 361 /* Collection */ 0xA1, 0x00, /* Physical */ 362 /* Usage */ 0x09, 0x30, /* X */ 363 /* Usage */ 0x09, 0x31, /* Y */ 364 /* Logical Minimum */ 0x15, 0x00, /* 0 */ 365 /* Logical Maximum */ 0x26, 0xFF,0x7F,/* 0x7fff */ 366 /* Physical Minimum */ 0x35, 0x00, /* 0 */ 367 /* Physical Maximum */ 0x46, 0xFF,0x7F,/* 0x7fff */ 368 /* Report Size */ 0x75, 0x10, /* 16 */ 369 /* Report Count */ 0x95, 0x02, /* 2 */ 370 /* Input */ 0x81, 0x02, /* Data, Value, Absolute, Bit field */ 364 371 /* Usage Page */ 0x05, 0x09, /* Button */ 365 372 /* Usage Minimum */ 0x19, 0x01, /* Button 1 */ … … 373 380 /* Report Size */ 0x75, 0x03, /* 3 (padding bits) */ 374 381 /* Input */ 0x81, 0x03, /* Constant, Value, Absolute, Bit field */ 375 /* Usage Page */ 0x05, 0x01, /* Generic Desktop */376 /* Usage */ 0x09, 0x38, /* Z (wheel) */377 /* Logical Minimum */ 0x15, 0x81, /* -127 */378 /* Logical Maximum */ 0x25, 0x7F, /* +127 */379 /* Report Size */ 0x75, 0x08, /* 8 */380 /* Report Count */ 0x95, 0x01, /* 1 */381 /* Input */ 0x81, 0x06, /* Data, Value, Relative, Bit field */382 /* Report Count */ 0x95, 0x01, /* 1 (padding byte) */383 /* Input */ 0x81, 0x03, /* Constant, Value, Absolute, Bit field */384 /* Usage Page */ 0x05, 0x01, /* Generic Desktop */385 /* Usage */ 0x09, 0x30, /* X */386 /* Usage */ 0x09, 0x31, /* Y */387 /* Logical Minimum */ 0x15, 0x00, /* 0 */388 /* Logical Maximum */ 0x26, 0xFF,0x7F,/* 0x7fff */389 /* Physical Minimum */ 0x35, 0x00, /* 0 */390 /* Physical Maximum */ 0x46, 0xFF,0x7F,/* 0x7fff */391 /* Report Size */ 0x75, 0x10, /* 16 */392 /* Report Count */ 0x95, 0x02, /* 2 */393 /* Input */ 0x81, 0x02, /* Data, Value, Absolute, Bit field */394 382 /* End Collection */ 0xC0, 395 383 /* End Collection */ 0xC0, … … 648 636 /* .bMaxPacketSize0 = */ 8, 649 637 /* .idVendor = */ VBOX_USB_VENDOR, 650 /* .idProduct = */ USBHID_PID_ TABLET,638 /* .idProduct = */ USBHID_PID_MULTI_TOUCH, 651 639 /* .bcdDevice = */ 0x0100, /* 1.0 */ 652 640 /* .iManufacturer = */ USBHID_STR_ID_MANUFACTURER, 653 /* .iProduct = */ USBHID_STR_ID_PRODUCT_ T,641 /* .iProduct = */ USBHID_STR_ID_PRODUCT_MT, 654 642 /* .iSerialNumber = */ 0, 655 643 /* .bNumConfigurations = */ 1 … … 911 899 case USBHIDMODE_ABSOLUTE: 912 900 { 913 pReport->t.rid = REPORTID_MOUSE;914 901 pReport->t.fButtons = pAccumulated->u.Absolute.fButtons; 915 902 pReport->t.x = pAccumulated->u.Absolute.x; 916 903 pReport->t.y = pAccumulated->u.Absolute.y; 917 pReport->t.dz = clamp_i8(pAccumulated->u.Absolute.dz);918 904 919 905 cbCopy = sizeof(pReport->t); 920 LogRel3(("Abs event, x=%d, y=%d, dz=%d,fButtons=%02x, report size %d\n",921 pReport->t.x, pReport->t.y, pReport->t. dz, pReport->t.fButtons,906 LogRel3(("Abs event, x=%d, y=%d, fButtons=%02x, report size %d\n", 907 pReport->t.x, pReport->t.y, pReport->t.fButtons, 922 908 cbCopy)); 923 909 break; … … 1038 1024 pThis->PtrDelta.u.Absolute.x = x >> pThis->u8CoordShift; 1039 1025 pThis->PtrDelta.u.Absolute.y = y >> pThis->u8CoordShift; 1040 pThis->PtrDelta.u.Absolute.dz -= dz; /* Inverted! */1041 1026 1042 1027 /* Send a report if possible. */
Note:
See TracChangeset
for help on using the changeset viewer.