Send a low-level virtual input event
virtual-inputSend keyboard, mouse, touch, or gamepad input to the active Roblox client to simulate player actions and control live game state.
Instructions
WRITES LIVE GAME STATE. Send keyboard, mouse, touch, or gamepad input into the active Roblox client. This is the broad low-level input surface: keyDown/keyUp/keyPress use Enum.KeyCode, mouseMove supports absolute or relative movement, mouseButton supports down/up/click, mouseWheel sends a wheel delta, touch sends Begin/Change/End, and gamepadButton/gamepadAxis target a gamepad. VirtualInputManager is preferred; common executor mouse/key fallbacks are used when available. Calls into VirtualInputManager are wrapped with newcclosure when the executor provides it. Unsupported executor APIs return a structured error rather than silently claiming success. Use press-key for the simpler keyboard-only case. Signature: { action: "keyDown" | "keyUp" | "keyPress" | "mouseMove" | "mouseButton" | "mouseWheel" | "touch" | "gamepadButton" | "gamepadAxis", key: string?, x: number?, y: number?, relative: any?, button: any?, buttonAction: any?, delta: any?, holdSec: any?, touchId: any?, touchState: any?, gamepad: any?, gamepadButton: string?, gamepadDown: any?, axis: string?, axisX: any?, axisY: any?, axisZ: any?, threadContext: number? }. Phase: act; cost=medium; idempotency=contextual-write. Requires: active-client, explicit-mutation-approval. Capabilities: VirtualInputManager. Produces: structured-result. Verify with: assert-state. Safety: MUTATING; writes live game/client state. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Screen X coordinate, or horizontal relative delta for mouseMove. | |
| y | No | Screen Y coordinate, or vertical relative delta for mouseMove. | |
| key | No | Exact Enum.KeyCode member name for keyDown, keyUp, or keyPress, such as W, Space, or LeftShift. | |
| axis | No | Exact Enum.KeyCode member name for a gamepad axis, such as Thumbstick1 or ButtonL2. | |
| axisX | No | Gamepad axis X/value component. | |
| axisY | No | Gamepad axis Y/value component. | |
| axisZ | No | Gamepad axis Z/value component. | |
| delta | No | Wheel delta for mouseWheel. | |
| action | Yes | The virtual input operation to perform. | |
| button | No | Mouse button for mouseButton. | Left |
| gamepad | No | Gamepad input device. | Gamepad1 |
| holdSec | No | Seconds to hold keyPress or a mouse click between down and up, capped at 10 seconds. | |
| touchId | No | Touch identifier for touch. | |
| relative | No | For mouseMove, use executor relative movement when true; otherwise use absolute screen coordinates. | |
| touchState | No | Touch phase. | Begin |
| gamepadDown | No | Pressed state for gamepadButton. | |
| buttonAction | No | Whether mouseButton sends down, up, or a down/up click. | click |
| gamepadButton | No | Exact Enum.KeyCode member name for a gamepad button, such as ButtonA or ButtonStart. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |