Actually the index values cannot be larger than 16 bits as otherwise they would

cross usage page boundaries.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31839 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-07-28 01:14:55 +00:00
parent ab1a1f9423
commit 92781ad394
2 changed files with 5 additions and 5 deletions

View File

@ -90,7 +90,7 @@ KeyboardDevice::KeyboardDevice(HIDReport *inputReport, HIDReport *outputReport)
TRACE("keyboard device with %lu keys and %lu modifiers\n", fKeyCount,
fModifierCount);
fLastKeys = (uint32 *)malloc(fKeyCount * 2 * sizeof(uint32));
fLastKeys = (uint16 *)malloc(fKeyCount * 2 * sizeof(uint16));
fCurrentKeys = &fLastKeys[fKeyCount];
if (fLastKeys == NULL) {
fStatus = B_NO_MEMORY;
@ -550,8 +550,8 @@ KeyboardDevice::_ReadReport(bigtime_t timeout)
static bool sysReqPressed = false;
bool keyDown = false;
uint32 *current = fLastKeys;
uint32 *compare = fCurrentKeys;
uint16 *current = fLastKeys;
uint16 *compare = fCurrentKeys;
for (int32 twice = 0; twice < 2; twice++) {
for (size_t i = 0; i < fKeyCount; i++) {
if (current[i] == 0 || (current[i] == 1 &&

View File

@ -45,8 +45,8 @@ private:
uint32 fModifierCount;
uint8 fLastModifiers;
uint32 * fCurrentKeys;
uint32 * fLastKeys;
uint16 * fCurrentKeys;
uint16 * fLastKeys;
};
#endif // USB_KEYBOARD_DEVICE_H