Hold a key down for a duration
browser_key_holdHolds a key down for a specified duration, then releases it, enabling game movement and drag-modifier workflows such as holding Shift while clicking.
Instructions
Press and HOLD a key for N milliseconds, then release — what you need for games (walk right, keep accelerating) and for drag-modifier workflows (hold Shift while clicking). A real keyDown is sent, the wait happens, then keyUp. Do not hold for very long; the page may repeat the key itself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key to hold (e.g. "ArrowRight", "w") | |
| context | No | Tab context id (default: the active tab) | |
| modifiers | No | Modifiers held at the same time | |
| durationMs | Yes | How long to hold, in milliseconds |