craftos_key
Send named keystrokes to a running ComputerCraft emulator session, with optional Ctrl or Shift modifiers and timed key holds for repeats or terminate signals.
Instructions
Press a key by name (enter, backspace, up, down, left, right, tab, escape, f1..f12, a..z, ...), with ctrl:true or shift:true held around it. A tap of ctrl+t does not terminate, as in the game: pass holdMs to hold the key down instead (key repeats every tick), and holding ctrl+t for 1000 ms or more sends terminate.
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": {
"id": "<id>",
"key": "<key>"
},
"name": "craftos_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Id returned by craftos_session_create. | |
| key | Yes | Key name, e.g. "enter", "up", "f1" or "c". | |
| ctrl | No | Hold Ctrl around the key. | |
| shift | No | Hold Shift around the key. | |
| holdMs | No | Hold the key this long instead of tapping it. |