Press and hold key
client.computers.keyDown(stringid, ComputerKeyDownParams { key, tab_id } body, RequestOptionsoptions?): ActionResult { error_message, executed_tab_id, page_context, 4 more }
POST/computers/{id}/key-down
Press and hold a keyboard key. Use with key_up to release. Supports modifier keys (shift, ctrl, alt, meta) for complex interactions like Shift+Click.
Supported keys: Modifier keys (shift, ctrl, alt, meta), special keys (enter, escape, tab, backspace, delete, space), arrow keys (arrowup, arrowdown, arrowleft, arrowright), navigation (home, end, pageup, pagedown), function keys (f1-f24), and any single character (a-z, 0-9).
Key names are case-insensitive: "shift", "Shift", and "SHIFT" all work.
Example Shift+Click: 1) key_down "shift", 2) click at coordinates, 3) key_up "shift"
Parameters
id: string
Returns
Press and hold key
import Lightcone from '@tzafon/lightcone';
const client = new Lightcone({
apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted
});
const actionResult = await client.computers.keyDown('id');
console.log(actionResult.executed_tab_id);{
"error_message": "error_message",
"executed_tab_id": "executed_tab_id",
"page_context": {
"device_scale_factor": 0,
"is_main_tab": true,
"page_height": 0,
"page_width": 0,
"scroll_x": 0,
"scroll_y": 0,
"tab_id": "tab_id",
"title": "title",
"url": "url",
"viewport_height": 0,
"viewport_width": 0
},
"request_id": "request_id",
"result": {
"foo": "bar"
},
"status": "status",
"timestamp": "timestamp"
}Returns Examples
{
"error_message": "error_message",
"executed_tab_id": "executed_tab_id",
"page_context": {
"device_scale_factor": 0,
"is_main_tab": true,
"page_height": 0,
"page_width": 0,
"scroll_x": 0,
"scroll_y": 0,
"tab_id": "tab_id",
"title": "title",
"url": "url",
"viewport_height": 0,
"viewport_width": 0
},
"request_id": "request_id",
"result": {
"foo": "bar"
},
"status": "status",
"timestamp": "timestamp"
}