UnstickKeys.exe for Windows
C.L. Distefano rev. 2020-09-07

Purpose:
Unstick shifting keys (Shift, Ctrl, Alt, Winkey) that are stuck in the
Down position

How It Works:
UnstickKeys runs in the background, using minimal resources. If it
detects that any shifting key(s) have been in the Down position for at
least 5 seconds (half that time if more than three of these keys are
down), UnstickKeys restores all shifting keys to their Up position. The
length of "Down" time that triggers an unstick operation is adjustable;
see Usage 1, first option. Since the stuck-key phenomenon can be endemic
to certain programs (for example, DOS emulation programs such as
vDosPlus and DOSBox-X), UnstickKeys can be instructed to operate only
when those programs are in the active windows; see Usage 1, option /T.

You can force an unstick operation manually; see Usage 2.

Usages:
1.  UnstickKeys.exe [n] [/D n] [/T ["]string["]] [/F]
      Optional parameter n is the time, in seconds, that shifting
        keys must be in the Down position to be treated as "stuck";
        default = 5 seconds. If present, n must be the first argument

      /D n is the number of shifting keys that must be simultaneously in
        the Down position to trigger a test for stuck keys; default = 1

      /T ["]string["] confines unstick operations to window(s) with
        title(s) that contain the specified (case-insensitive) string,
        and only when such window(s) are in focus. For example, to
        confine operations to vDosPlus, specify /T vdosplus. The string
        may be a regular expression. For example, to confine operations
        to vDosPlus and DOSBox-X, specify /T vdosplus^|dosbox-x. Note
        that the caret "^" must be used to "escape" the piping symbol
        "|" on the command line.

      Note: Enabling the /T option is **recommended**.

      /F displays a "flag" (Windows tooltip) to signal an unstick
        operation in progress; also reports the total number of unstick
        operations since launch time

2.  To force an unstick operation manually (with UnStickKeys running):
    Turn NumLock Off, then hold down Numpad 5 until you see the flag
      in the upper left-hand corner of the screen (flag displays even
      if option /F is omitted)

3.  To pause UnstickKeys, hold down the PrintScreen key until the pause
      flag apppears in the upper left of the screen. To resume, hold
      down PrintScreen until the flag disappears

4.  To display the current UnstickKeys user settings, press the
      PopUp Menu key (located between Right-Winkey and Right-Ctrl on
      standard Windows keyboards)

Note: If UnstickKeys is limited to one or more designated windows
      (option /T), usages 3 and 4 above (PrintScreen and PopUp Menu
      keys) will be operative only in those windows.
      
5.  UnstickKeys.exe /K(ill)
       Kills UnstickKeys.exe

Note: Using UnstickKeys with Windows Sticky Keys or Filter Keys is
      not recommended.
