Tap a key
press_keySimulates keyboard key presses in the FiveM game window using GTA scan codes, with an optional hold duration, to automate in-game controls.
Instructions
Press and release a key (scan codes — what GTA's DirectInput/raw input reads). Key name: W A S D E F Q space enter esc tab shift ctrl alt arrows up down left right, f1-f12, letters/digits.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"key": "<key>"
},
"name": "press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| holdMs | No | Hold duration (default 20) |