Changeset 89938 in vbox for trunk/src/VBox/Devices/Input
- Timestamp:
- Jun 29, 2021 6:57:51 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2K.cpp
r89935 r89938 733 733 else if (u8HidPage == USB_HID_CC_PAGE) 734 734 { 735 for ( inti = 0; i < RT_ELEMENTS(aPS2CCKeys); ++i)735 for (unsigned i = 0; i < RT_ELEMENTS(aPS2CCKeys); ++i) 736 736 if (aPS2CCKeys[i].usageId == u16HidUsage) 737 737 { … … 744 744 else if (u8HidPage == USB_HID_DC_PAGE) 745 745 { 746 for ( inti = 0; i < RT_ELEMENTS(aPS2DCKeys); ++i)746 for (unsigned i = 0; i < RT_ELEMENTS(aPS2DCKeys); ++i) 747 747 if (aPS2CCKeys[i].usageId == u16HidUsage) 748 748 { … … 764 764 } 765 765 766 static uint32_t ps2kR3InternalCodeToHid( int iKeyCode)766 static uint32_t ps2kR3InternalCodeToHid(unsigned uKeyCode) 767 767 { 768 768 uint16_t u16HidUsage; 769 769 uint32_t u32HidCode = 0; 770 770 771 if (( iKeyCode >= PS2K_PAGE_DC_START) && (iKeyCode <= PS2K_PAGE_DC_END))772 { 773 u16HidUsage = aPS2DCKeys[ iKeyCode - PS2K_PAGE_DC_START].usageId;771 if ((uKeyCode >= PS2K_PAGE_DC_START) && (uKeyCode <= PS2K_PAGE_DC_END)) 772 { 773 u16HidUsage = aPS2DCKeys[uKeyCode - PS2K_PAGE_DC_START].usageId; 774 774 u32HidCode = RT_MAKE_U32(u16HidUsage, USB_HID_DC_PAGE); 775 775 } 776 else if (( iKeyCode >= PS2K_PAGE_CC_START) && (iKeyCode <= PS2K_PAGE_CC_END))777 { 778 u16HidUsage = aPS2CCKeys[ iKeyCode - PS2K_PAGE_CC_START].usageId;776 else if ((uKeyCode >= PS2K_PAGE_CC_START) && (uKeyCode <= PS2K_PAGE_CC_END)) 777 { 778 u16HidUsage = aPS2CCKeys[uKeyCode - PS2K_PAGE_CC_START].usageId; 779 779 u32HidCode = RT_MAKE_U32(u16HidUsage, USB_HID_CC_PAGE); 780 780 } 781 781 else /* Must be the keyboard usage page. */ 782 782 { 783 if ( iKeyCode <= VBOX_USB_MAX_USAGE_CODE)784 u32HidCode = RT_MAKE_U32( iKeyCode, USB_HID_KB_PAGE);783 if (uKeyCode <= VBOX_USB_MAX_USAGE_CODE) 784 u32HidCode = RT_MAKE_U32(uKeyCode, USB_HID_KB_PAGE); 785 785 else 786 AssertMsgFailed((" iKeyCode out of range! (%d)\n", iKeyCode));786 AssertMsgFailed(("uKeyCode out of range! (%u)\n", uKeyCode)); 787 787 } 788 788 … … 1120 1120 LogFlowFunc(("Releasing keys...\n")); 1121 1121 1122 for ( int iKey = 0; iKey < sizeof(pThis->abDepressedKeys); ++iKey)1123 if (pThis->abDepressedKeys[ iKey])1122 for (unsigned uKey = 0; uKey < RT_ELEMENTS(pThis->abDepressedKeys); ++uKey) 1123 if (pThis->abDepressedKeys[uKey]) 1124 1124 { 1125 ps2kR3ProcessKeyEvent(pDevIns, pThis, ps2kR3InternalCodeToHid( iKey), false /* key up */);1126 pThis->abDepressedKeys[ iKey] = 0;1125 ps2kR3ProcessKeyEvent(pDevIns, pThis, ps2kR3InternalCodeToHid(uKey), false /* key up */); 1126 pThis->abDepressedKeys[uKey] = 0; 1127 1127 } 1128 1128 LogFlowFunc(("Done releasing keys\n"));
Note:
See TracChangeset
for help on using the changeset viewer.