Game Control (LL 26.5) part 2: send controller + keyboard input to scripts (GameControlData via SDL3 gamepads) #1203

Closed
opened 2026-10-28 16:16:49 +00:00 by sky_line · 1 comment
Owner

Builds on part 1. This is the minimal path that makes game_control scripts work with a controller (or the keyboard) in Slipstream.

Scope

  • SDL3 gamepad support: SDL_INIT_GAMEPAD after window creation (indra/llwindow/llsdl.cpp only inits VIDEO today), plus gamepad add/remove/axis/button events.
    • A leftover //LLGameControl::handleEvent(...) hook sits in indra/llwindow/llwindowsdl.cpp.
    • Deadzones; the SDL controller mapping database (gamecontrollerdb.txt, zlib).
    • Check that the Windows 3p-sdl3 package has the gamepad backends, and the Linux udev/evdev permissions.
  • Keyboard to semantic translation: movement keys become ModeAxes / ModeButtons, matching LL's mapping, so scripts get input without a controller.
  • Packing GameControlData, with LL's send scheme:
    • full state in every packet;
    • resend at 100 ms, then x4 backoff;
    • paced to the region's frame rate.
  • Gating: only on regions with GameControlEnabled, and only with the preference on.
  • One preference checkbox (send controller input to scripts), off by default until LL's own default is clear.
  • Our own implementation (about 1,000 lines), using LL's template comments and PR as the spec, rather than their roughly 4,500-line llgamecontrol.cpp.

Not in scope

Driving the avatar, camera or flycam locally from the pad: part 3.

Research (local): research/GAME_CONTROL_2026-10-28.md. Upstream: LL viewer PR secondlife/viewer#6202 ("Game Control Alpha", merged to release/26.5 on 2026-10-17); wiki https://wiki.secondlife.com/wiki/LSL_Game_Control_Beta and https://wiki.secondlife.com/wiki/Game_control.

Builds on part 1. This is the minimal path that makes `game_control` scripts work with a controller (or the keyboard) in Slipstream. ## Scope - **SDL3 gamepad support:** `SDL_INIT_GAMEPAD` after window creation (`indra/llwindow/llsdl.cpp` only inits VIDEO today), plus gamepad add/remove/axis/button events. - A leftover `//LLGameControl::handleEvent(...)` hook sits in `indra/llwindow/llwindowsdl.cpp`. - Deadzones; the SDL controller mapping database (gamecontrollerdb.txt, zlib). - Check that the Windows 3p-sdl3 package has the gamepad backends, and the Linux udev/evdev permissions. - **Keyboard to semantic translation:** movement keys become ModeAxes / ModeButtons, matching LL's mapping, so scripts get input without a controller. - **Packing GameControlData**, with LL's send scheme: - full state in every packet; - resend at 100 ms, then x4 backoff; - paced to the region's frame rate. - **Gating:** only on regions with `GameControlEnabled`, and only with the preference on. - **One preference checkbox** (send controller input to scripts), off by default until LL's own default is clear. - Our own implementation (about 1,000 lines), using LL's template comments and PR as the spec, rather than their roughly 4,500-line llgamecontrol.cpp. ## Not in scope Driving the avatar, camera or flycam locally from the pad: part 3. Research (local): research/GAME_CONTROL_2026-10-28.md. Upstream: LL viewer PR secondlife/viewer#6202 ("Game Control Alpha", merged to release/26.5 on 2026-10-17); wiki https://wiki.secondlife.com/wiki/LSL_Game_Control_Beta and https://wiki.secondlife.com/wiki/Game_control.
sky_line added this to the Slipstream project 2026-10-28 16:16:49 +00:00
Author
Owner

Shipped in 1.5.0 Beta 5 (2026-10-29).

Shipped in **1.5.0 Beta 5** (2026-10-29).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#1203
No description provided.