retroarch_input_set_analog
Set an analog stick's X/Y position for a player. Ideal for analog movement, camera control, or pressure-sensitive navigation; values persist until changed, so recenter with (0,0) when done.
Instructions
PURPOSE: Set one analog stick's X/Y position for a player (values persist until changed). USAGE: For analog movement, camera control, or pressure-sensitive navigation on cores that read analog sticks. Values are int16: -32768 (full left/up) to 32767 (full right/down), 0,0 = centered. Like buttons, analog state LATCHES — recenter with (0, 0) or retroarch_input_release_all when done. Sends two datagrams (X then Y), which the receiver applies over two consecutive frames. BEHAVIOR: Two receiver behaviors govern all input tools: (1) LATCHING — a pressed button stays down until an explicit release; there is no auto-release or keepalive. Always pair presses with releases or use retroarch_input_release_all. (2) ONE DATAGRAM PER FRAME — RetroArch consumes at most one queued input message per emulated frame per player, so N changes sent back-to-back land over N consecutive frames. For frame-accurate scripting: pause, then alternate one input tool call with one retroarch_frame_advance per change. Transport: RetroArch's Network Gamepad receiver over UDP (default 127.0.0.1:55400 + player index; requires network_remote_enable = true AND network_remote_enable_user_p1 = true (per player) in retroarch.cfg, or Settings > Input > Network Gamepad). This is a SEPARATE channel from the NCI command port — enabling Network Commands alone is not enough. Fire-and-forget UDP — no acknowledgement. RETURNS: 'Analog STICK set to (X, Y) (player N)' — UDP-send confirmation only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Horizontal axis: -32768 = full left, 0 = centered, 32767 = full right. | |
| y | Yes | Vertical axis: -32768 = full up, 0 = centered, 32767 = full down. | |
| stick | Yes | Which analog stick to set. | |
| player | No | Player index, 0-based (see retroarch_input_press). Default 0. |