inject_mouse_button
Simulate mouse clicks in a running Unreal Engine PIE session by injecting button events into the PlayerController without moving the cursor, for testing. Press and release are separate calls.
Instructions
Fire a simulated mouse click at a running PIE session's PlayerController: fire/aim/interact without a human at the mouse. Press and release are SEPARATE calls, so a click is two of them and a hold is press now, release later. It injects the button only -- it does not move the cursor, so aim with set_control_rotation first. Requires an active PIE session; use inject_key_input for keyboard/gamepad buttons and click_pie_widget for UMG buttons, which this does NOT reach.
Returns: { injected: bool (the event was delivered to the controller, NOT that the game reacted -- verify with state), button: string, event: string, pie_client_index: int }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event | No | Optional "Pressed" (default) or "Released". A full click needs both, in two calls. | |
| button | No | Optional "Left"|"Right"|"Middle" (default "Left"); anything else is a clean error. | |
| pie_client_index | No | Optional int (default 0). Which PIE client window to aim at -- 0 is the server/host window in a ListenServer session, 1 the first client. |