Don't exit early when encountering an empty slot in the report. There seem to
be keyboards that leave gaps. It's not really specified in the docs, they only say that the ordering of keys is indetermined. So I guess intermixing empty slots is equally valid. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29106 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -324,51 +324,51 @@ KeyboardDevice::_InterpretBuffer()
|
|||||||
uint8 *compare = fTransferBuffer;
|
uint8 *compare = fTransferBuffer;
|
||||||
for (int32 twice = 0; twice < 2; twice++) {
|
for (int32 twice = 0; twice < 2; twice++) {
|
||||||
for (size_t i = 2; i < fTotalReportSize; i++) {
|
for (size_t i = 2; i < fTotalReportSize; i++) {
|
||||||
if (current[i] != 0x00 && current[i] != 0x01) {
|
if (current[i] == 0x00 || current[i] == 0x01)
|
||||||
bool found = false;
|
continue;
|
||||||
for (size_t j = 2; j < fTotalReportSize; j++) {
|
|
||||||
if (compare[j] == current[i]) {
|
bool found = false;
|
||||||
found = true;
|
for (size_t j = 2; j < fTotalReportSize; j++) {
|
||||||
break;
|
if (compare[j] == current[i]) {
|
||||||
}
|
found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// a change occured
|
// a change occured
|
||||||
uint32 key = 0;
|
uint32 key = 0;
|
||||||
if (current[i] < sKeyTableSize)
|
if (current[i] < sKeyTableSize)
|
||||||
key = sKeyTable[current[i]];
|
key = sKeyTable[current[i]];
|
||||||
|
|
||||||
if (key == KEY_Pause && (current[0] & 1))
|
if (key == KEY_Pause && (current[0] & 1))
|
||||||
key = KEY_Break;
|
key = KEY_Break;
|
||||||
else if (key == 0xe && (current[0] & 1))
|
else if (key == 0xe && (current[0] & 1))
|
||||||
key = KEY_SysRq;
|
key = KEY_SysRq;
|
||||||
#if 0
|
#if 0
|
||||||
else if (keyDown && key == 0x0d) // ToDo: remove again
|
else if (keyDown && key == 0x0d) // ToDo: remove again
|
||||||
panic("keyboard requested halt.\n");
|
panic("keyboard requested halt.\n");
|
||||||
#endif
|
#endif
|
||||||
else if (key == 0) {
|
else if (key == 0) {
|
||||||
// unmapped key
|
// unmapped key
|
||||||
key = 0x200000 + current[i];
|
key = 0x200000 + current[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
_WriteKey(key, keyDown);
|
_WriteKey(key, keyDown);
|
||||||
|
|
||||||
if (keyDown) {
|
if (keyDown) {
|
||||||
// repeat handling
|
// repeat handling
|
||||||
fCurrentRepeatKey = key;
|
fCurrentRepeatKey = key;
|
||||||
fCurrentRepeatDelay = fRepeatDelay;
|
fCurrentRepeatDelay = fRepeatDelay;
|
||||||
} else {
|
} else {
|
||||||
// cancel the repeats if they are for this key
|
// cancel the repeats if they are for this key
|
||||||
if (fCurrentRepeatKey == key) {
|
if (fCurrentRepeatKey == key) {
|
||||||
fCurrentRepeatDelay = B_INFINITE_TIMEOUT;
|
fCurrentRepeatDelay = B_INFINITE_TIMEOUT;
|
||||||
fCurrentRepeatKey = 0;
|
fCurrentRepeatKey = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
current = fTransferBuffer;
|
current = fTransferBuffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user