KeyRoutines
ConditionFreecond.input.keyHeld

Check if a key is held down to change what a routine does

Key or button held is true while a key, a combination or a mouse button is being held down. Its favourite use is a "hold Shift for the other version" variant of a hotkey routine.

How it works

  • Enter the key, combination or button, for example Shift, Ctrl+Alt, LCtrl or MouseX1.
  • It is true only while every key of the combination is physically held at the moment the condition is checked.
  • Plain Ctrl, Alt and Shift accept either the left or right key, and Win accepts either Win key; use LCtrl or a similar name to require one side.
  • It reads the keyboard state once when checked, with no keyboard hook and nothing running in the background.

Routines that use it

Shift for the other monitor

A hotkey runs Move and resize to the left monitor, but an If on Shift held sends the window to the right one instead.

Hold to force

A Close app routine asks nicely by default; holding Ctrl while pressing the hotkey switches to a Close app step that ends apps at once.

Mouse button modifier

When a Hotkey on MouseX2 fires, an If on MouseX1 held picks Media control next track instead of play or pause.

Settings

SettingWhat it does
KeysThe key, mouse button or combination that must be held, for example Shift, Ctrl+Alt or MouseX1.

Good to know

  • It's checked once, at the moment the If or Wait until evaluates it, rather than watched continuously.

Questions

Can one shortcut do two different things?
Yes. Start the routine with an If on Key or button held, such as Shift, and give each branch its own steps. Press the hotkey normally for one action and with Shift held for the other.
Does checking a held key slow down my PC?
No. It reads the key state once when the routine checks it, without installing a keyboard hook or running anything in the background.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.