simulate_input
Simulate keyboard and mouse input for automated testing and UI interaction. In Play Mode, keys and mouse reach the game even while the Unity window is in the background.
分類: テスト
| 名前 | 型 | 必須 | 既定値 | 説明 |
|---|---|---|---|---|
action |
string | 必須 | "key_tap" |
Type of input action. 値: key_press, key_release, key_tap, mouse_click, mouse_move, mouse_drag, ui_click |
key |
string | Key to press (e.g., ‘Space’, ‘A’, ‘Return’, ‘Escape’) | ||
position |
object | Screen position for mouse actions (origin at bottom-left) | ||
button |
integer | 0 |
Mouse button (0=left, 1=right, 2=middle) | |
selector |
string | U-Selector for UI element to click (for ui_click action) | ||
duration |
number | 0.1 |
Duration in seconds for drag operations |
呼び出しの例
Section titled “呼び出しの例”必須の引数だけを入れています。ほかは必要に応じて足してください。
{ "name": "simulate_input", "arguments": { "action": "key_press" }}SuperSave モードでは
Section titled “SuperSave モードでは”Unity を NANORA_MCP_SUPERSAVE=1 で起動したときは、メタツール execute から {"tool": "simulate_input", "args": { … }} の形で呼びます。SuperSave モードを参照。
Assets/NanoraUnityMCP/Editor/Tools/SimulateInputTool.cs(版 1.2.1)から生成しています。説明文はツール定義のまま(英語)です。AI クライアントは tools/list で同じスキーマを受け取ります。