Skip to content

Conversation

@RyeMutt
Copy link
Contributor

@RyeMutt RyeMutt commented Dec 31, 2025

Description

This pull request aims to restore the efforts at improving gamepad support via the game_control functionality from the archive/develop branch

Related Issues

  • Please link to a relevant GitHub issue for additional context.
    • Bug Fix: Link to an issue that includes reproduction steps and testing guidance.
    • Feature/Enhancement: Link to an issue with a write-up, rationale, and requirements.

Issue Link:


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • The PR is linked to a relevant issue with sufficient context.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request restores gamepad support functionality from the archive/develop branch by implementing a comprehensive game_control system using SDL3.

  • Adds SDL3-based game controller detection and management
  • Implements gamepad input translation for avatar/camera control
  • Provides UI for configuring game controller mappings and device settings

Reviewed changes

Copilot reviewed 71 out of 74 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
indra/newview/tests/llgamecontrol_stub.cpp Stub implementation for testing (has SDL2 reference that should be SDL3)
indra/newview/llagent.{h,cpp} Adds game control integration for avatar movement and flycam
indra/newview/llflycam.{h,cpp} New flycam control class for camera manipulation
indra/newview/llfloaterpreference.{h,cpp} Extensive game control preferences UI implementation
indra/newview/llviewerjoystick.{h,cpp} Integration with 3DConnexion device detection
indra/llwindow/llgamecontrol.h Core game control API and data structures
indra/llwindow/llgamecontroltranslator.{h,cpp} Translation between game control and avatar actions
indra/llwindow/llwindow*.{h,cpp} Window system integration for game control events
indra/llwindow/llkeyboard*.{h,cpp} Keyboard API updates for modifier handling
indra/newview/skins/default/xui/en/*.xml UI definitions for game control preferences

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

AndrewMeadows and others added 2 commits December 31, 2025 12:37
avatar_motion-->GameControl translation and flycam

more GameControl prefs UI

Add GameControl UI for per device settings

put GameControl behind a feature flag

add enable_game_control checkbox to GameControl prefs

more correct AgentUpdate transmission logic

even more correct GameControl feature-flag switch

more correct application of GameControl prefs

remove crashy LLSD ctor used by GameControl

fix GameControl save settings, fix linux build

Port to SDL3 api and fix linux event handling

Fix issues with game control preferences:
* Add missing names for controls to make content localizable
* Fix labels for controls that are obviously wrong/make no sense

Signed-off-by: Rye <rye@alchemyviewer.org>
Fix releaseGameControlButton to use bitwise op correctly
Fix gamecontrol_stub comment and SDL3 include

Signed-off-by: Rye <rye@alchemyviewer.org>
@akleshchev akleshchev requested a review from Geenz January 5, 2026 19:40
Copy link
Collaborator

@AndrewMeadows AndrewMeadows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm delighted to see this code resurrected. All of my feedback is just suggestions.

To be clear: this PR should not be merged until after the develop-linux branch is merged, because we don't want to block the Linux changes with the game_control feature. After develop-linux is merged we should re-target this PR to aim at develop.


// construct LLSD version of g_deviceOptions but only include non-empty values
LLSD deviceOptions = LLSD::emptyMap();
for (const auto& data_pair : g_deviceOptions)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since first writing this I've learned: structured bindings in for loops over containers can make for more readable code. Therefore: for bonus points use: for (const auto& (guid, options) : g_device_options).

@RyeMutt RyeMutt changed the title Restoration of game_control support from archive/develop [DO NOT MERGE] Restoration of game_control support from archive/develop Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants