How is automatic keyboard repeat implemented on Windows PCs?

I want to be able to intercept (and do arbitrary processing) auto-repetition of keystrokes on Windows. I would like to know how the keyboard auto-repeat is done so that I know what options I have. that is, I can intercept with:

  • applications,
  • device driver and / or
  • hardware level

?

Update: It looks like auto-replay (bad?) Is generated in hardware and then overridden by device drivers ( see here ).

+1


a source to share


3 answers


To change or change the behavior of a filter, you can hook the keys:

SetWindowsHookEx

through WH_KEYBOARD

hook procedure gets, among other things, the number of times to retry (due to the key being held down)

Note that the low-level keyboard hook ( WH_KEYBOARD_LL

) does not receive a retry count.



If all of your windows are created in the same head, you can use thread-specific binding and not move the hook procedure into the DLL.


I vaguely remember that the repeated counts are generated by the keyboard itself, and the LL hook dispatches repeated keydown events - I may be wrong. In DOS, the key repeat rate and time set in the BIOS or when invoking the BIOS would return to their defaults when the DIN or PS / 2 keyboard was disabled and overloaded. I'm not sure WHY you need to know exactly.

+2


a source


I suggest you change your question ... your actual question is "How to disable auto-repeat on Windows in $ {yourLangauge}" ...

My answer I have no idea, I just did it in assembler (MASM 80286) ... and even then I found the solution on BBS (does anyone remember them) and just used it. From memory, interception must be performed at the device driver level.

The autorepeat implementation ($ 100 says it's an assembler) probably doesn't shed light on suppressing this ... and Microsoft is playing with these cards very close to it.



Greetings. Whale.

EDIT: I was just thinking ... the methods may now be different between window versions and many different devices ... Oh, okay!

0


a source


Sounds like that it is not related to programming. Go to Accessibility Options in Control Panel. Select "Preferences" under "Filter Groups", here you can disable duplicate keys for this user on this computer.

Hope this is what you are looking for.

PS Above instructions are for Windows XP.

0


a source







All Articles