Changeset 47725 in vbox for trunk/src/VBox/Devices/Input
- Timestamp:
- Aug 14, 2013 1:36:09 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/UsbMouse.cpp
r47672 r47725 230 230 uint32_t u32LastTouchScanTime; 231 231 bool fTouchReporting; 232 bool fTouchStateUpdated; 232 233 } USBHID; 233 234 /** Pointer to the USB HID instance data. */ … … 284 285 uint32_t u32ScanTime; 285 286 } USBHIDMT_REPORT, *PUSBHIDMT_REPORT; 287 288 typedef struct USBHIDMT_REPORT_POINTER 289 { 290 uint8_t idReport; 291 uint8_t fButtons; 292 uint16_t x; 293 uint16_t y; 294 } USBHIDMT_REPORT_POINTER; 286 295 #pragma pack() 287 296 … … 1140 1149 pThis->enmState = USBHIDREQSTATE_READY; 1141 1150 pThis->fHasPendingChanges = false; 1151 pThis->fTouchStateUpdated = false; 1142 1152 1143 1153 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aEps); i++) … … 1353 1363 LogRel3(("usbHid: all touch contacts reported\n")); 1354 1364 pThis->fTouchReporting = false; 1355 pThis->fHasPendingChanges = false;1365 pThis->fHasPendingChanges = pThis->fTouchStateUpdated; 1356 1366 } 1357 1367 else … … 1622 1632 } 1623 1633 1634 pThis->fTouchStateUpdated = true; 1624 1635 pThis->fHasPendingChanges = true; 1625 1636 … … 1813 1824 u8ReportType, u8ReportID, 1814 1825 pUrb->cbData - sizeof(VUSBSETUP), &pUrb->abData[sizeof(VUSBSETUP)])); 1815 uint32_t cbData = 0;1816 1826 if (pSetup->bRequest == GET_REPORT) 1817 1827 { 1818 if (u8ReportType == 3 && u8ReportID == REPORTID_TOUCH_MAX_COUNT) 1828 uint32_t cbData = 0; /* 0 means that the report is unsupported. */ 1829 1830 if (u8ReportType == 1 && u8ReportID == REPORTID_TOUCH_POINTER) 1831 { 1832 USBHIDMT_REPORT_POINTER *p = (USBHIDMT_REPORT_POINTER *)&pUrb->abData[sizeof(VUSBSETUP)]; 1833 /* The actual state should be reported here. */ 1834 p->idReport = REPORTID_TOUCH_POINTER; 1835 p->fButtons = 0; 1836 p->x = 0; 1837 p->y = 0; 1838 cbData = sizeof(USBHIDMT_REPORT_POINTER); 1839 } 1840 else if (u8ReportType == 1 && u8ReportID == REPORTID_TOUCH_EVENT) 1841 { 1842 USBHIDMT_REPORT *p = (USBHIDMT_REPORT *)&pUrb->abData[sizeof(VUSBSETUP)]; 1843 /* The actual state should be reported here. */ 1844 RT_ZERO(*p); 1845 p->idReport = REPORTID_TOUCH_EVENT; 1846 cbData = sizeof(USBHIDMT_REPORT); 1847 } 1848 else if (u8ReportType == 3 && u8ReportID == REPORTID_TOUCH_MAX_COUNT) 1819 1849 { 1820 1850 pUrb->abData[sizeof(VUSBSETUP) + 0] = REPORTID_TOUCH_MAX_COUNT; … … 1831 1861 cbData = sizeof(sau8QASampleBlob) + 1; 1832 1862 } 1863 else if (u8ReportType == 3 && u8ReportID == REPORTID_TOUCH_DEVCONFIG) 1864 { 1865 pUrb->abData[sizeof(VUSBSETUP) + 0] = REPORTID_TOUCH_DEVCONFIG; 1866 pUrb->abData[sizeof(VUSBSETUP) + 1] = 2; /* Device mode: 1867 * "HID touch device supporting contact 1868 * identifier and contact count maximum." 1869 */ 1870 pUrb->abData[sizeof(VUSBSETUP) + 2] = 0; /* Device identifier */ 1871 cbData = 3; 1872 } 1873 1874 if (cbData > 0) 1875 { 1876 rc = usbHidCompleteOk(pThis, pUrb, sizeof(VUSBSETUP) + cbData); 1877 } 1878 else 1879 { 1880 rc = usbHidCompleteStall(pThis, pEp, pUrb, "Unsupported GET_REPORT MT"); 1881 } 1833 1882 } 1834 1835 rc = usbHidCompleteOk(pThis, pUrb, sizeof(VUSBSETUP) + cbData); 1883 else 1884 { 1885 /* SET_REPORT */ 1886 rc = usbHidCompleteOk(pThis, pUrb, pUrb->cbData); 1887 } 1836 1888 } break; 1837 1889 default:
Note:
See TracChangeset
for help on using the changeset viewer.