Key Down
Press keyboard key (without releasing).
Interface Description
Interface Type
keyDownParameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
deviceId | string | ✅ | - | Device ID |
key | string | ✅ | - | Key name |
key Parameter Values
Supported function keys:
| Key | Description | Example Use |
|---|---|---|
RIGHT | Right arrow | Navigate right |
LEFT | Left arrow | Navigate left |
DOWN | Down arrow | Navigate down |
UP | Up arrow | Navigate up |
ENTER | Enter key | Confirm, line break |
DEL | Delete key | Delete content |
BACKSPACE | Backspace key | Delete character |
END | End key | Jump to end |
HOME | Home key | Jump to beginning |
PAGEDOWN | PageDown key | Page down |
PAGEUP | PageUp key | Page up |
ESC | Esc key | Cancel, exit |
TAB | Tab key | Switch focus |
CTRL | Ctrl key | Control key (combination) |
SHIFT | Shift key | Shift key (combination) |
ALT | Alt key | Alt key (combination) |
COMMAND | Command key | macOS combination key |
F1 - F12 | Function keys | System function shortcuts |
💡 Letter and Number Keys
For letter keys (A-Z) and number keys (0-9), use the sendKey interface, which automatically handles press and release.
Return Value
javascript
true // Returns true on successful operationBasic Usage
javascript
// Press Enter key
await apiInvoke('keyDown', {
deviceId: 'P72578581E07',
key: 'ENTER'
});
// Note: Must be used with keyUp
await apiInvoke('keyUp', {
deviceId: 'P72578581E07',
key: 'ENTER'
});