Changeset 82213 in vbox for trunk/src/VBox/Devices/Input/DrvKeyboardQueue.cpp
- Timestamp:
- Nov 26, 2019 2:08:48 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135027
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DrvKeyboardQueue.cpp
r81214 r82213 83 83 PDMQUEUEITEMCORE Core; 84 84 /** The keycode. */ 85 uint32_t u32UsageCode;85 uint32_t idUsage; 86 86 } DRVKBDQUEUEITEM, *PDRVKBDQUEUEITEM; 87 87 … … 212 212 213 213 /** 214 * Queues a scancode-based keyboard event. 214 * @interface_method_impl{PDMIKEYBOARDPORT,pfnPutEventScan} 215 * 215 216 * Because of the event queueing the EMT context requirement is lifted. 216 *217 * @returns VBox status code.218 * @param pInterface Pointer to this interface structure.219 * @param u8ScanCode The scan code to translate/queue.220 217 * @thread Any thread. 221 218 */ … … 227 224 return VINF_SUCCESS; 228 225 229 uint32_t u32Usage = 0; 230 pDrv->XlatState = ScancodeToHidUsage(pDrv->XlatState, u8ScanCode, &u32Usage); 231 232 if (pDrv->XlatState == SS_IDLE) { 226 uint32_t idUsage = 0; 227 pDrv->XlatState = ScancodeToHidUsage(pDrv->XlatState, u8ScanCode, &idUsage); 228 229 if (pDrv->XlatState == SS_IDLE) 230 { 233 231 PDRVKBDQUEUEITEM pItem = (PDRVKBDQUEUEITEM)PDMQueueAlloc(pDrv->pQueue); 234 232 if (pItem) … … 239 237 * key up into a key up/key down sequence. 240 238 */ 241 if ( u32Usage == 0x80000090 || u32Usage == 0x80000091)239 if (idUsage == UINT32_C(0x80000090) || idUsage == UINT32_C(0x80000091)) 242 240 { 243 241 PDRVKBDQUEUEITEM pItem2 = (PDRVKBDQUEUEITEM)PDMQueueAlloc(pDrv->pQueue); … … 249 247 { 250 248 /* Manufacture a key down event. */ 251 pItem2-> u32UsageCode = u32Usage & ~0x80000000;249 pItem2->idUsage = idUsage & ~UINT32_C(0x80000000); 252 250 PDMQueueInsert(pDrv->pQueue, &pItem2->Core); 253 251 } 254 252 } 255 253 256 pItem-> u32UsageCode = u32Usage;254 pItem->idUsage = idUsage; 257 255 PDMQueueInsert(pDrv->pQueue, &pItem->Core); 258 256 … … 269 267 270 268 /** 271 * Queues a HID-usage-based keyboard event. 269 * @interface_method_impl{PDMIKEYBOARDPORT,pfnPutEventHid} 270 * 272 271 * Because of the event queueing the EMT context requirement is lifted. 273 *274 * @returns VBox status code.275 * @param pInterface Pointer to this interface structure.276 * @param u32UsageCode The HID usage code to queue.277 272 * @thread Any thread. 278 273 */ 279 static DECLCALLBACK(int) drvKbdQueuePutEventHid(PPDMIKEYBOARDPORT pInterface, uint32_t u32UsageCode)274 static DECLCALLBACK(int) drvKbdQueuePutEventHid(PPDMIKEYBOARDPORT pInterface, uint32_t idUsage) 280 275 { 281 276 PDRVKBDQUEUE pDrv = IKEYBOARDPORT_2_DRVKBDQUEUE(pInterface); … … 287 282 if (pItem) 288 283 { 289 pItem-> u32UsageCode = u32UsageCode;284 pItem->idUsage = idUsage; 290 285 PDMQueueInsert(pDrv->pQueue, &pItem->Core); 291 286 … … 357 352 PDRVKBDQUEUE pThis = PDMINS_2_DATA(pDrvIns, PDRVKBDQUEUE); 358 353 PDRVKBDQUEUEITEM pItem = (PDRVKBDQUEUEITEM)pItemCore; 359 int rc = pThis->pUpPort->pfnPutEventHid(pThis->pUpPort, pItem-> u32UsageCode);354 int rc = pThis->pUpPort->pfnPutEventHid(pThis->pUpPort, pItem->idUsage); 360 355 return RT_SUCCESS(rc); 361 356 }
Note:
See TracChangeset
for help on using the changeset viewer.