uloop-simulate-mouse-input

Simulate mouse clicks, movement deltas, and scroll events in Unity PlayMode.

500|44|Updated Jun 15, 2025
One-click install
npx skills add https://github.com/hatayama/unity-cli-loop --skill uloop-simulate-mouse-input
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uloop-simulate-mouse-input
Source: https://github.com/hatayama/unity-cli-loop/tree/main/.agents/skills/uloop-simulate-mouse-input
Command: npx skills add https://github.com/hatayama/unity-cli-loop --skill uloop-simulate-mouse-input

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Simulate mouse input in Unity PlayMode so tests and automation can trigger game logic that reads the New Input System (for example, Mouse.current.leftButton.wasPressedThisFrame) without a physical user.

Core Features & Use Cases

  • Click and LongPress: Inject left/right/middle button presses at specific screen coordinates to trigger gameplay actions like attacks, block placement, or UI interactions that rely on Input System button events.
  • MoveDelta and SmoothDelta: Inject instantaneous or smoothly interpolated mouse movement deltas for FPS camera control and automated camera pans.
  • Scroll: Inject scroll wheel input for hotbar switching, zooming, or other scroll-driven mechanics.
  • Practical workflow: Ensure Unity is in PlayMode, determine target screen coordinates (use a screenshot to find them), run the appropriate simulate-mouse-input action, then capture a verification screenshot.

Quick Start

Invoke uloop simulate-mouse-input with an action (e.g., Click or MoveDelta) and the appropriate parameters such as --x --y or --delta-x to inject the desired mouse event into the running Unity PlayMode.

Frequently Asked Questions about uloop-simulate-mouse-input

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I simulate mouse input in Unity PlayMode to test game logic that uses the New Input System?

Simulate mouse input in Unity PlayMode by injecting clicks, movement deltas, and scroll events that trigger Input System bindings. These actions interact with game code reading Mouse.current APIs without requiring a physical user to be present.

Can I inject mouse movement deltas for FPS camera control during automated Unity testing?

You can inject mouse movement deltas for FPS camera control during automated testing. The MoveDelta action injects instantaneous movement, while SmoothDelta injects smoothly interpolated deltas to simulate natural automated camera pans.

Does Unity simulated mouse input work with game code that reads Mouse.current.leftButton.wasPressedThisFrame?

Simulated mouse input works directly with game code reading Mouse.current.leftButton.wasPressedThisFrame. It injects Input System button events at specific screen coordinates to trigger gameplay actions like attacks or UI interactions.

What do I need to set up before automating mouse clicks in Unity PlayMode?

Before automating mouse clicks, ensure Unity is in PlayMode, the com.unity.inputsystem package is installed, and your game code reads Mouse.current APIs. Determine target screen coordinates using a screenshot to execute the action accurately.

How do I trigger scroll wheel input for hotbar switching or zooming in Unity PlayMode tests?

Trigger scroll wheel input for hotbar switching or zooming in Unity PlayMode tests using the Scroll action. This injects scroll wheel input that activates scroll-driven mechanics through the New Input System bindings.