Fixed a bug reported by Stippi: when a report from the USB device contained a key up
and a key down event at the same time, the key repeat timer didn't work. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20978 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -414,6 +414,7 @@ interpret_kb_buffer(hid_device_info *device)
|
|||||||
{
|
{
|
||||||
uint8 modifiers = ((uint8*)device->buffer)[0];
|
uint8 modifiers = ((uint8*)device->buffer)[0];
|
||||||
uint8 bits = device->last_buffer[0] ^ modifiers;
|
uint8 bits = device->last_buffer[0] ^ modifiers;
|
||||||
|
bool timerSet = false;
|
||||||
uint32 i, j;
|
uint32 i, j;
|
||||||
|
|
||||||
if (bits) {
|
if (bits) {
|
||||||
@@ -446,6 +447,7 @@ interpret_kb_buffer(hid_device_info *device)
|
|||||||
// unmapped key
|
// unmapped key
|
||||||
key = 0x200000 + ((uint8*)device->buffer)[i];
|
key = 0x200000 + ((uint8*)device->buffer)[i];
|
||||||
}
|
}
|
||||||
|
//dprintf("key down: %x, mapping: %lx\n", ((uint8*)device->buffer)[i], key);
|
||||||
|
|
||||||
write_key(device, key, true);
|
write_key(device, key, true);
|
||||||
|
|
||||||
@@ -454,6 +456,7 @@ interpret_kb_buffer(hid_device_info *device)
|
|||||||
device->repeat_timer.key = key;
|
device->repeat_timer.key = key;
|
||||||
add_timer(&device->repeat_timer.timer, timer_delay_hook,
|
add_timer(&device->repeat_timer.timer, timer_delay_hook,
|
||||||
device->repeat_delay, B_ONE_SHOT_RELATIVE_TIMER);
|
device->repeat_delay, B_ONE_SHOT_RELATIVE_TIMER);
|
||||||
|
timerSet = true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
@@ -485,7 +488,8 @@ interpret_kb_buffer(hid_device_info *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
write_key(device, key, false);
|
write_key(device, key, false);
|
||||||
cancel_timer(&device->repeat_timer.timer);
|
if (!timerSet)
|
||||||
|
cancel_timer(&device->repeat_timer.timer);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user