Skip to content

Key Down

Press keyboard key (without releasing).

Interface Description

Interface Type

keyDown

Parameters

ParameterTypeRequiredDefaultDescription
deviceIdstring-Device ID
keystring-Key name

key Parameter Values

Supported function keys:

KeyDescriptionExample Use
RIGHTRight arrowNavigate right
LEFTLeft arrowNavigate left
DOWNDown arrowNavigate down
UPUp arrowNavigate up
ENTEREnter keyConfirm, line break
DELDelete keyDelete content
BACKSPACEBackspace keyDelete character
ENDEnd keyJump to end
HOMEHome keyJump to beginning
PAGEDOWNPageDown keyPage down
PAGEUPPageUp keyPage up
ESCEsc keyCancel, exit
TABTab keySwitch focus
CTRLCtrl keyControl key (combination)
SHIFTShift keyShift key (combination)
ALTAlt keyAlt key (combination)
COMMANDCommand keymacOS combination key
F1 - F12Function keysSystem 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 operation

Basic 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'
});

Cooperation: try.catch@foxmail.com