made this a little bit less weird

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12906 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen
2005-05-30 20:00:02 +00:00
parent f1909366e4
commit fddbbc88ef
@@ -192,9 +192,10 @@ handle_keyboard_interrupt(void *data)
keyInfo.timestamp = system_time();
keyInfo.scancode = scancode;
while (packet_buffer_write(sKeyBuffer, (uint8 *)&keyInfo, sizeof(keyInfo)) == 0) {
// if there is no space left in the buffer, we start dropping old key strokes
packet_buffer_flush(sKeyBuffer, sizeof(keyInfo));
if (packet_buffer_write(sKeyBuffer, (uint8 *)&keyInfo, sizeof(keyInfo)) == 0) {
// If there is no space left in the buffer, we drop this key stroke. We avoid
// dropping old key strokes, to not destroy what already was typed.
return B_HANDLED_INTERRUPT;
}
release_sem_etc(sKeyboardSem, 1, B_DO_NOT_RESCHEDULE);