oblitum / Interception

The Interception API aims to build a portable programming interface that allows one to intercept and control a range of input devices.
http://oblita.com/interception
1.35k stars 269 forks source link

Interception of repeted keys fails #17

Closed cloidnerux closed 8 years ago

cloidnerux commented 8 years ago

Holding a key down or repeatedly pressing the same key does not get issued by interception. With the following start of the while loop:

raise_process_priority();

context = interception_create_context();

interception_set_filter(context, interception_is_keyboard, INTERCEPTION_FILTER_KEY_ALL);
while(interception_receive(context, device = interception_wait(context), &stroke, 1) > 0)
{
    [...]//processing

The processing is intended to block certain keys, which works fine, as long as one does not hold the key down such that key repetition kicks in or pressing the key quit faste multiple times.

oblitum commented 8 years ago

I'll have to check it but I suspect the repetition behavior does not result in multiple key-down event, if you press a key down and don't release, it's just one key-down event that's really happening, you can configure the operating system regarding how it should behave in this situation, and the repetition will come from OS, not the device, so interception is not responsible for the repetition, conversely if you send a single key down event through interception, repetition will also happen not because it's sending multiple key down events, but because the OS just received a key down without a key up following.

I'll close this for now and reopen in case my description is mistaken.