Sends a key combination (press then release).
Combo format: modifier keys joined with + followed by the main key.
Either-side modifiers: Ctrl, Shift, Alt, Win.
Lateral modifiers: LCtrl, RCtrl, LShift, RShift, LAlt, RAlt, LWin, RWin.
Key combination string, e.g. "Ctrl+Shift+T", "Alt+F4", "Enter".
OptionalsettleMs: numberDelay in milliseconds between modifier press and key press. Defaults to 5.
Creates a KeySequence builder for batching multiple keyboard operations.
All steps execute sequentially on a single native thread with no JS event-loop overhead between them. Call .Send() to execute the batch.
Registers a callback that fires on every raw keyboard event (key down and key up). The script enters an event loop and stays alive as long as this handler is registered.
Handler receiving a KeyEvent for each keyboard event.
Focuses a window and sends a key combination to it. This is a convenience wrapper that calls Window.Focus() followed by Keyboard.Press().
Window identifier from WindowInfo.id.
Key combination string, e.g. "Ctrl+C", "Enter".
USE CASE: Sending input to a specific app while keeping it in the foreground. The window is focused before the key is sent. For background delivery without stealing focus, use PostKey instead.
Posts a window message to a specific window using PostMessageW. Use for low-level message injection (e.g. WM_KEYDOWN, WM_CHAR).
Window identifier from WindowInfo.id.
Windows message constant (e.g. 0x0100 for WM_KEYDOWN).
wParam value for the message.
lParam value for the message.
USE CASE: Background automation, the target window does not need to be focused.
LIMITATION: Unreliable for competitive games using Raw Input and DirectInput applications; use Keyboard.Press for those instead. Works well for standard Win32 and WPF applications.
Posts WM_KEYDOWN and WM_KEYUP messages for a key combination to a specific window.
Convenience wrapper around PostMessage that constructs proper keyboard messages including modifier keys and scan codes.
Window identifier from WindowInfo.id.
Key combination string, e.g. "Ctrl+V", "A".
USE CASE: Background key injection without focusing the window. Handles modifier key press/release ordering automatically. LIMITATION: Unreliable for games and DirectInput applications.