Simulate Key Press
Actionkeyboard.badge.ellipsis
action.simulate_keys
Simulate a keyboard shortcut on macOS. The key combination is recorded using a hotkey recorder in the inspector and played back via CGEvent when the node executes. This allows workflows to control other applications by sending keystrokes.
Requires Accessibility permissions to be granted to Watchflows in System Settings.
Destructive action
Synthetic keystrokes go to whichever application has keyboard focus at the moment the workflow fires — that means a configured Cmd+Q can quit any frontmost app, Cmd+W can close a critical document, and Cmd+Shift+Delete can empty the Trash. Watchflows surfaces an inline warning when the configured shortcut matches a known destructive combination. Workflows configured this way prompt for confirmation on every arm.
Ports
| Direction | Name | Data Type | Description |
|---|---|---|---|
| Input | Input | Any | Incoming payload |
| Output | Output | Any | Passthrough after keystroke |
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| shortcut | Hotkey Recorder | — | Click to record the keyboard shortcut to simulate |
Output Variables
| Variable | Type | Description |
|---|---|---|
| pressed | Boolean | Whether the key press was simulated |
| shortcut | String | Human-readable key combo that was pressed |
Example
Toggle Do Not Disturb with a keyboard shortcut trigger: