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:
Michael Lotz 2009-01-31 23:04:09 +00:00
parent 7c2cc28dc9
commit 3c33e2749f

View File

@ -324,51 +324,51 @@ KeyboardDevice::_InterpretBuffer()
uint8 *compare = fTransferBuffer;
for (int32 twice = 0; twice < 2; twice++) {
for (size_t i = 2; i < fTotalReportSize; i++) {
if (current[i] != 0x00 && current[i] != 0x01) {
bool found = false;
for (size_t j = 2; j < fTotalReportSize; j++) {
if (compare[j] == current[i]) {
found = true;
break;
}
if (current[i] == 0x00 || current[i] == 0x01)
continue;
bool found = false;
for (size_t j = 2; j < fTotalReportSize; j++) {
if (compare[j] == current[i]) {
found = true;
break;
}
}
if (found)
continue;
if (found)
continue;
// a change occured
uint32 key = 0;
if (current[i] < sKeyTableSize)
key = sKeyTable[current[i]];
// a change occured
uint32 key = 0;
if (current[i] < sKeyTableSize)
key = sKeyTable[current[i]];
if (key == KEY_Pause && (current[0] & 1))
key = KEY_Break;
else if (key == 0xe && (current[0] & 1))
key = KEY_SysRq;
if (key == KEY_Pause && (current[0] & 1))
key = KEY_Break;
else if (key == 0xe && (current[0] & 1))
key = KEY_SysRq;
#if 0
else if (keyDown && key == 0x0d) // ToDo: remove again
panic("keyboard requested halt.\n");
else if (keyDown && key == 0x0d) // ToDo: remove again
panic("keyboard requested halt.\n");
#endif
else if (key == 0) {
// unmapped key
key = 0x200000 + current[i];
}
else if (key == 0) {
// unmapped key
key = 0x200000 + current[i];
}
_WriteKey(key, keyDown);
_WriteKey(key, keyDown);
if (keyDown) {
// repeat handling
fCurrentRepeatKey = key;
fCurrentRepeatDelay = fRepeatDelay;
} else {
// cancel the repeats if they are for this key
if (fCurrentRepeatKey == key) {
fCurrentRepeatDelay = B_INFINITE_TIMEOUT;
fCurrentRepeatKey = 0;
}
if (keyDown) {
// repeat handling
fCurrentRepeatKey = key;
fCurrentRepeatDelay = fRepeatDelay;
} else {
// cancel the repeats if they are for this key
if (fCurrentRepeatKey == key) {
fCurrentRepeatDelay = B_INFINITE_TIMEOUT;
fCurrentRepeatKey = 0;
}
} else
break;
}
}
current = fTransferBuffer;