Earlier quoted context omitted.
This doesn't seem to explain how it would happen after plugging in a new keyboard, or trying to use the on-screen keyboard, though...
Same generic keyboard debouncing in use in all 3 instances on the windows end? I know windows drivers debounce mouse clicks because I had a really old mouse that would double and triple click by accident on Linux but not in windows. I might be wrong, but changing the device might not affect it if the different devices are handled by shared runtime code
But what about the on-screen keyboard? Do on-screen key presses get routed through the keyboard device driver too?