retroarch_input_tap
Tap RetroPad buttons with a configurable hold duration for menu navigation and gameplay inputs, automatically pressing and releasing each button.
Instructions
PURPOSE: Press buttons, hold them for a duration, then release them — the everyday building block for menu navigation and normal play. USAGE: Use while emulation is RUNNING (state 'playing' per retroarch_get_status). The default 100 ms hold spans ~6 frames at 60 fps, comfortably above the one-datagram-per-frame application delay and typical game input-polling windows. For frame-accurate work while PAUSED, do not use this tool — compose retroarch_input_press / retroarch_frame_advance / retroarch_input_release manually, because this tool's hold is wall-clock and a paused emulator never samples it. BEHAVIOR: Sends press datagrams, waits hold_ms of wall-clock time, sends release datagrams. Multiple buttons latch over consecutive frames (see below), so a two-button chord is fully held only from the second frame of the hold window onward. 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. RETURNS: 'Tapped BUTTONS for HOLDms (player N)' after the release datagrams are sent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| player | No | Player index, 0-based (see retroarch_input_press). Default 0. | |
| buttons | Yes | RetroPad button names (case-insensitive): b, y, select, start, up, down, left, right, a, x, l, r, l2, r2, l3, r3. | |
| hold_ms | No | Wall-clock hold duration in milliseconds. Default 100 (~6 frames at 60 fps). Minimum 16 (~1 frame); values under ~50 ms risk the game's input poll missing the press entirely on cores that debounce. |