/** * Press a single key (with optional modifiers) using CDP `Input.dispatchKeyEvent`. * * Why CDP and not synthetic `KeyboardEvent`: * - Native input handling (textarea cursor movement, IME composition, app-level * accelerators) responds to the OS-level key stream that CDP feeds, not to * `dispatchEvent(new KeyboardEvent(...))`. * * For shortcuts targeted at `document` (e.g. global hotkeys), prefer * `electron_send_keyboard_shortcut`, which uses synthetic events and is * cheaper. Use this when you need a key event the renderer treats as real * keyboard input. * * ⚠️ macOS OS-level text-editing shortcuts are NOT executed: * `Cmd+A` (selectAll), `Cmd+C` / `Cmd+V` / `Cmd+X` (clipboard), * `Cmd+Z` / `Cmd+Shift+Z` (undo/redo), and Electron `role: 'selectAll'` * style menu items. CDP `Input.dispatchKeyEvent` only feeds a synthetic * KeyboardEvent into the renderer; the OS keybinding layer that handles * these shortcuts is bypassed. Playwright shares the same constraint. * * Workarounds: * - select all text in an input/textarea: * `electron_eval` running `document.querySelector('...').select()` or * `el.setSelectionRange(0, el.value.length)`. * - clipboard ops: `electron_eval` with the `navigator.clipboard.*` API. * - app-level hotkeys (registered as `mousetrap`/`keydown` listeners on * `document`): prefer `electron_send_keyboard_shortcut` (synthetic event, * cheaper, and what app code expects). */ export declare const pressKey: import("../types").CommandModule;