The underlying question that I am trying to answer is simple:
What is the maximum number of characters per second that can theoretically be written using an HID device in Windows 10?
In order to answer this, I must find out how the Windows 10 OS handles keyboard input. After scrolling through hundreds of pages of documentation I am more confused than anything else.
Background information gathered
From basic electronics knowledge one knows that for a hardware button press to be interpreted by software it can be checked in two ways: polling and interrupts.
Polling is repeatedly checking the state of the hardware for a change in input value.
Interrupts are a hardware-triggered events that interrupt the main line code to provide information about a change on the hardware.
Since polling is extremely ineffective at handling events that need to have an instantaneous response, interrupts tend to be used. Polling is not used as to monitor instantaneous change would require a very high frequency of polling, many many times per second using up too many system resources.
I am therefore guessing that the Windows OS uses hardware interrupts to handle keyboard presses. However, most mechanical push buttons are subjet to bouncing and need approximately 10ms to be debounced. I am guessing this sets a maximal theoretical limit, from a hardware perspective to ~100Hz.
But what about software? How does Windows 10 handle the interrupts? How many interrupts can be generated per second?