Skip to main content

Module modifiers

Module modifiers 

Source
Expand description

Release physically-held modifier keys before synthesizing input.

In a push-to-talk dictation app a modifier is held by construction at the moment injection fires. SendInput does not reset keyboard state:

This function does not reset the keyboard’s current state. Any keys that are already pressed when the function is called might interfere with the events that this function generates.

So a user holding Right-Alt turns a synthesized Ctrl+V into AltGr+V, which is a different character on many layouts. No dictation tool surveyed does this.

Functions§

any_held
True if any modifier is currently held. Cheap pre-check for callers that want to log or delay.
sanitize
Synthesize key-up for every modifier currently held.