Skip to main content

Send Keys

Sends keystroke commands to the active window

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.

Input

  • Key - The key to send. (e.g c or x)

Options

  • Key Modifier 1 - First keystroke can be one of the following:

    • Enter
    • Shift
    • Ctrl
    • Win
    • Alt
    • Escape
    • Home
    • Delete
    • Insert
    • End
    • Space
    • Tab
    • Page up
    • Page down
    • Left
    • Up
    • Right
    • Down
    • Backspace
    • Command
    • Print Screen
    • F1
    • F2
    • F3
    • F4
    • F5
    • F6
    • F7
    • F8
    • F9
    • F10
    • F11
    • F12
  • Key Modifier 2 - Second additional keystroke command, options are the same as for Key Modifier 1.

  • Key Modifier 3 - Third additional keystroke command, options are the same as for Key Modifier 1 and 2.

How It Works

The Send Keys node simulates keyboard input by sending keystrokes to the currently active window on your desktop. The execution follows these steps:

  1. Delay Before - Waits for the specified delay before execution (if configured)
  2. Modifier Validation - Validates each key modifier (1, 2, and 3) against the list of supported keys
  3. Key Normalization - Converts certain modifiers to their standard forms (e.g., "control" to "ctrl", "win" to "cmd")
  4. Key Press Simulation - Uses the robotgo library to simulate the key press:
    • If a key is provided with modifiers, presses the modifiers + key combination
    • If only a key is provided, presses that single key
    • If only modifiers are provided, presses the modifier keys in order
  5. Delay After - Waits for the specified delay after execution (if configured)

The order of key presses is important: Modifier 1, then Modifier 2, then Modifier 3, followed by the Key input.

Requirements

  • Robomotion Deskbot - This node only works with Robomotion Deskbot (desktop automation)
  • Active Window - The target window must be active and in focus to receive the keystrokes
  • Operating System Support - Compatible with Windows, macOS, and Linux
  • Permissions - May require accessibility permissions on macOS and some Linux distributions

Error Handling

Error CodeDescriptionCommon Cause
Keyboard.SendKeys.ErrOnCreateConfiguration parse errorInvalid node configuration or corrupted flow
Core.Keyboard.SendKeys.ErrKeyModifierInvalid key modifierKey modifier value is not in the supported list

Usage Examples

Example 1: Copy Text with Ctrl+C

Send the Ctrl+C keyboard shortcut to copy selected text:

Key: c
Key Modifier 1: Ctrl
Key Modifier 2: (empty)
Key Modifier 3: (empty)

Example 2: Save File with Ctrl+S

Send the Ctrl+S keyboard shortcut to save a file:

Key: s
Key Modifier 1: Ctrl
Key Modifier 2: (empty)
Key Modifier 3: (empty)

Example 3: Send Function Key

Press F5 to refresh a browser or application:

Key: (empty)
Key Modifier 1: F5
Key Modifier 2: (empty)
Key Modifier 3: (empty)

Example 4: Send Complex Combination

Send Ctrl+Shift+Esc to open Task Manager (Windows):

Key: escape
Key Modifier 1: Ctrl
Key Modifier 2: Shift
Key Modifier 3: (empty)

Usage Notes

  • Key Timing - All modifiers are held down simultaneously when the key is pressed, simulating a real keyboard combination
  • Case Sensitivity - The Key input is case-sensitive. Use lowercase for regular keys
  • Empty Key - You can leave the Key field empty to press only modifier keys (e.g., just pressing Enter or Escape)
  • Platform Differences - "Win" modifier maps to "Command" on macOS and Windows key on Windows/Linux
  • Focus Required - The keystrokes are sent to whichever window is currently active, so ensure proper window activation before this node

Tips

  1. Add Delays - Use "Delay Before" to ensure the target window is ready to receive input
  2. Window Focus - Always activate the target window before sending keys to avoid sending keystrokes to the wrong application
  3. Test Combinations - Test keyboard combinations manually first to ensure they work in your target application
  4. Use Type Text for Strings - For typing actual text content, use the Type Text node instead of Send Keys
  5. Modifier Order - When multiple modifiers are needed, the conventional order is Ctrl, Shift, Alt
  6. Error Handling - Enable "Continue On Error" for non-critical keyboard actions in unstable UI environments
  • Type Text - For typing text strings instead of individual key combinations
  • Mouse Click - For clicking UI elements
  • Application In - For launching applications before sending keys