Hotkeys three ways: press, hold, toggle

Bind a macro to a hotkey, then feel the difference between the three run modes on a lamp wall. press_release plays the macro once per press, while_held runs it only while the key is down, and toggle starts a run on one press and stops it on the next. Toggle only shows itself on a run that is still going, so you loop the macro and watch the wall's press counter: climbing means a run is alive, frozen means it stopped.

keyboard hold vs tap toggle Free 10 min

A hotkey run mode is one setting that quietly changes everything about how a macro behaves. This lab makes the difference concrete: you loop a macro and watch a counter to see each mode happen instead of just reading about it.

Open the target first. It opens in a new tab; point QHuman at it and read its counters as you go.

Open Key Lights

Key Lights is a wall of lamps that reacts only to real keyboard events. Keys 1 to 4 are hold lamps: each lights while its key is down and darkens on release. The Space toggle lamp flips OFF and ON per press, but that is a toggle key on the page, not QHuman's toggle run mode, so leave it aside here. The number to watch for the whole lab is total presses (all keys). Press R on the target to reset every counter between attempts.

The wall mid-run: the macro you build taps key 1, so lamp 1 climbs while the rest sit dark. The big number on the right is the heartbeat this lab keeps reading, and yours shows zeros until a run starts.

Build the macro

  1. Record a looping one-key macro Record a tiny macro that taps a single key, say 1: Record, tap the key once, Stop, Save. Hold the mouse still while you do it so the recording stays nearly pure keyboard. (Record keyboard is still on from Your first macro; if not, flip it in Settings → Recording first.) Then, on the Playback tab under the editor, set the macro to Loop forever. The loop is the point: one start keeps the key firing, so a counter climbs while the macro runs.
    The Playback tab's loop choices. Loop forever means a run only ends when something stops it, and what can stop it is exactly what the three run modes disagree about.
  2. Open the macro's Hotkey tab Select the macro in the left list, then click the Hotkey tab in the same row as Playback. The whole tab is one line of controls: a capture button, Clear, the run-mode picker, and Apply.
  3. Capture a key and try press_release Click the capture button (it reads Click to set a hotkey) and press a single key with no modifier, say F8. Skip 1 to 4, Space, R and F (your own fingers would poke the wall), and skip modifier combos like Ctrl+Shift+9: while_held holds the key down, so a held Shift or Ctrl rides along and changes the key your macro sends. Leave the run mode on press_release and click Apply. Now click the Key Lights tab so the macro's keystrokes land on the wall, and press F8 once: the loop starts and lamp 1's presses count climbs. Press it again and nothing visible changes. press_release cannot stop a run; the second press only queues another run for after this one finishes, and a loop-forever run never does. The off switch is Stop (Ctrl+Alt+S) or slamming a screen corner. Stop the run, then reset the wall with R.
    The whole Hotkey tab, key captured and ready to Apply. The picker holds the three run modes this lab walks through; changes fire immediately, no restart.
  4. Switch the same binding to while_held Change the run mode to while_held and Apply, then hold F8 down. The macro runs only while the key is physically down, so lamp 1's presses count climbs while you hold and freezes the instant you let go. (This mode brings its own loop: while a while_held key is down the macro repeats no matter what the Playback tab says.) Hold, release, and watch the count stop on release.
  5. Now set the same binding to toggle Change the run mode to toggle and Apply. Press F8 once: the loop starts and the presses count climbs steadily. Press it a second time while it is still running: the count freezes. Only toggle stops a run that is still going, and because the macro loops it is still going when your second press lands. A single-tap macro would already be finished, so the second press would just start it again.
  6. Compare the three back to back Run all three modes on the same looping macro, resetting with R between runs, and check what you feel against the picture below. Same macro, same key, three different answers to "when does it stop".
    The three modes on one looping macro. The blue stretch is the run; the total presses (all keys) heartbeat climbs exactly as long as the blue lasts.
Checkpoint

You have proven all three modes on one looping macro when you can predict the heartbeat before you press: under while_held the count climbs only inside the hold, under toggle a second press freezes it mid-climb, and under press_release a second press changes nothing you can see, because it cannot stop a run. If your wall matches the step 6 picture mode for mode, the lab is done.

Make it yours

Now bind the same looping macro to a second key, but set the loop to a fixed 5-second stretch instead of loop-until-stopped. Predict first: on toggle, will a second press two seconds in still freeze the presses count? Run it and confirm the heartbeat stops.

If it went wrong

  • A second press will not stop the run The binding is on press_release or while_held, not toggle. Only toggle stops a run that is still going when you press again. Set the run mode to toggle and Apply.
  • The second press just starts it again instead of stopping The first run had already finished before you pressed again, and toggle can only stop a run that is still in flight. Give the macro a longer loop (more seconds, or loop until stopped) and press again while lamp 1's presses count is still climbing.
  • The presses count races ahead of your presses That is the loop doing its job: with no gap between passes the macro taps far faster than a hand. If you want it calmer, put a small number in Between loops on the Playback tab, and give each hotkey press a clean tap.
  • Nothing on the wall moves The key never reached the page. Click the target once so it has focus, and make sure the key does nothing in the focused window (a per-macro hotkey does not block the key).

Keep going

Want the full detail behind bindings and run modes? Read the hotkeys guide. Ready for the next challenge? Try Click it 4 times, where you teach QHuman to see a target and act on it.