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:
parent
ab1a1f9423
commit
92781ad394
@ -90,7 +90,7 @@ KeyboardDevice::KeyboardDevice(HIDReport *inputReport, HIDReport *outputReport)
|
|||||||
TRACE("keyboard device with %lu keys and %lu modifiers\n", fKeyCount,
|
TRACE("keyboard device with %lu keys and %lu modifiers\n", fKeyCount,
|
||||||
fModifierCount);
|
fModifierCount);
|
||||||
|
|
||||||
fLastKeys = (uint32 *)malloc(fKeyCount * 2 * sizeof(uint32));
|
fLastKeys = (uint16 *)malloc(fKeyCount * 2 * sizeof(uint16));
|
||||||
fCurrentKeys = &fLastKeys[fKeyCount];
|
fCurrentKeys = &fLastKeys[fKeyCount];
|
||||||
if (fLastKeys == NULL) {
|
if (fLastKeys == NULL) {
|
||||||
fStatus = B_NO_MEMORY;
|
fStatus = B_NO_MEMORY;
|
||||||
@ -550,8 +550,8 @@ KeyboardDevice::_ReadReport(bigtime_t timeout)
|
|||||||
static bool sysReqPressed = false;
|
static bool sysReqPressed = false;
|
||||||
|
|
||||||
bool keyDown = false;
|
bool keyDown = false;
|
||||||
uint32 *current = fLastKeys;
|
uint16 *current = fLastKeys;
|
||||||
uint32 *compare = fCurrentKeys;
|
uint16 *compare = fCurrentKeys;
|
||||||
for (int32 twice = 0; twice < 2; twice++) {
|
for (int32 twice = 0; twice < 2; twice++) {
|
||||||
for (size_t i = 0; i < fKeyCount; i++) {
|
for (size_t i = 0; i < fKeyCount; i++) {
|
||||||
if (current[i] == 0 || (current[i] == 1 &&
|
if (current[i] == 0 || (current[i] == 1 &&
|
||||||
|
@ -45,8 +45,8 @@ private:
|
|||||||
uint32 fModifierCount;
|
uint32 fModifierCount;
|
||||||
|
|
||||||
uint8 fLastModifiers;
|
uint8 fLastModifiers;
|
||||||
uint32 * fCurrentKeys;
|
uint16 * fCurrentKeys;
|
||||||
uint32 * fLastKeys;
|
uint16 * fLastKeys;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // USB_KEYBOARD_DEVICE_H
|
#endif // USB_KEYBOARD_DEVICE_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user