Hold down a physical key (key.down)
The hardware keyboard behavior described on this page is available in versions after 20260805
Declaration
key.down(keycode)
Parameters
- keycode
String. Physical key code. See Samples and supported key codes.
Description
Simulate pressing down a physical key. Important: Without a global hardware keyboard, call the corresponding
key.upafterwards. Otherwise the key may remain held even after the script ends. A global hardware keyboard releases all held keys when it is disconnected or the script stops.
- After a global hardware keyboard is connected, standard keyboard and keypad keys use that object. Media and vendor-defined keys keep their previous behavior
- This function remains paired with the matching
key.up. If the hardware keyboard has already disconnected, the key was released during disconnection and the laterkey.upsends no input - Calls through
key(...):down()follow the same rules