gamepad
Control a virtual Xbox 360 controller in a session: press buttons, push sticks, pull triggers, hold inputs, or release all. Test programs that read controller input.
Instructions
Work a virtual gamepad, in a session started with gamepads: press buttons together, tapped, held for hold seconds, or with state down left down until a call with state up; push a stick to x, y; pull a trigger to value; or neutral, letting go of everything. A stick or trigger stays where it's put, unless hold says for how long. Programs in the session see a real Xbox 360 controller, and none of the machine's.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | The stick, left to right | |
| y | No | The stick, up to down | |
| pad | No | Which of the session's pads (1) | |
| hold | No | Seconds to keep it down before letting go | |
| state | No | Only press, leaving it down until a call with up; or only let go | |
| value | No | The trigger, let go to pulled all the way | |
| which | No | Which stick or trigger | |
| action | Yes | Press buttons, push a stick, pull a trigger, or let go of everything | |
| buttons | No | a b x y lb rb back start guide ls rs, and the d-pad's up down left right | |
| session | Yes | Its name, from start_session |