dolphin_press_gc_buttons
Set GameCube controller state for one frame. Specify buttons and axes to press; omitted inputs are released. Use with frame advance for TAS sequences.
Instructions
PURPOSE: Set GameCube controller state on a given port for one frame's worth of input. USAGE: Buttons supported: A, B, X, Y, Z, Start, L, R, Up, Down, Left, Right. Analog axes: StickX, StickY, CStickX, CStickY, TriggerLeft, TriggerRight. To 'hold' a button across multiple frames, call repeatedly — Dolphin's input is per-frame, not edge-triggered, so a button you don't include in this call's state is implicitly released. For TAS-style frame-perfect sequences, alternate set + dolphin_frame_advance(1) calls. BEHAVIOR: DESTRUCTIVE to controller state for the addressed port. Overwrites all input — anything you don't include is released. Felk's set_gc_buttons accepts a partial dict; unspecified buttons are false, unspecified analog axes are at neutral (0 for both sticks and triggers). RETURNS: 'Set GC port N: '.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | GameCube controller port (0-3, defaults to 0 for port 1). Wii games sometimes accept GC controllers — try port 0 if unsure. | |
| state | Yes | Button/axis state object. Boolean keys for digital buttons (A, B, X, Y, Z, Start, L, R, Up, Down, Left, Right). Integer keys for analog axes — StickX/StickY/CStickX/CStickY accept -128..127 (0 = center), TriggerLeft/TriggerRight accept 0..255 (0 = released). Omit a key to leave it at neutral (false / 0). |
Implementation Reference
- bridge/mcp_bridge.py:103-103 (helper)The Python bridge handler that calls Felk's dolphin.controller.set_gc_buttons(port, state) to actually set the GameCube controller buttons in Dolphin.
def _set_gc_buttons(p): controller.set_gc_buttons(p[0], p[1]); return None - bridge/mcp_bridge.py:151-151 (helper)Registration of 'controller.set_gc_buttons' method in the bridge's HANDLERS dict, mapping the RPC method name to the _set_gc_buttons helper function.
"controller.set_gc_buttons": _set_gc_buttons,