SendKeys
Simulate keyboard input in Observable notebooks by sending keystrokes to specific elements, including special keys and modifier combos, to test and debug notebook behavior.
Instructions
Simulate keyboard input. Dispatches keydown, keypress (for printable characters), and keyup events to the target element.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | Keys to send. Plain characters are sent as-is. Special keys use braces: {Enter}, {Tab}, {Escape}, {Backspace}, {Delete}, {ArrowUp}, {ArrowDown}, {ArrowLeft}, {ArrowRight}, {Space}, {Home}, {End}, {F1}-{F12}. Modifier combos: {Ctrl+a}, {Shift+Tab}, {Meta+s}. | |
| notebook | No | Target notebook (URL, path like "index" or "voronoi", or index like "0"). Optional if you've used FocusNotebook or only one notebook is connected. | |
| selector | No | CSS selector for target element. If not provided, sends to the currently focused element. | |
| modifiers | No | Modifier keys to hold during all keystrokes | |
| timeout_ms | No | Maximum time to wait in milliseconds |