-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Auto-Assign Controllers #706
base: master
Are you sure you want to change the base?
Conversation
…nd update related components
…ve controller refresh logic
…better controller management
…nditionally update configuration
…tionality; update gamepad connection handling to load configuration while in Input settings.
… order caused the configuration to load incorrectly.
…pad connection changes; improve controller assignment logic and ensure proper LED color settings
…ion methods; changed some settings for LED color
… color handling in the new function.
…in settings (no easy way to constantly update it)
…ConfiguredController function.
I've been testing on windows, I might of encountered a bug? Player 1 and Player 2 linked to separate controllers. When controller 2 disconnects, Player 1 Controller controls both Player 1 and Player 2 after telling the game to use CPU. Steps to possibly reproduce:
This should cause the issue noted above. Endless loop of the game asking to use CPU but pressing any button will result in controlling bother players. Edit: I tried this with more controllers on the same game, Player 1 assumes control of the rest of the players. Player 2 and Player 3 are Disabled and "Waiting for link". Taking control of the rest of the players only happens after a button is pressed (On Player 1) other than the movement. |
Hi @h3kt0rx, thanks for the feedback! You're absolutely right - there's an issue in the code. I'm pushing a fix right now. Let me know if it works :) |
Thanks for all the work you're doing! The controller issue has been a pain in every switch emulator I've tried, best PR ever. I'd love to test, however, I'm a noob to compiling. I followed the instructions but running the game crashes so I'm sure I'm doing it wrong with the dotnet command or something. |
you do not need to compile. The first comment on this PR contains up-to-date builds containing the changes of this PR. Edit: My bad, first time contributors need to be approved to have their builds made and I hadn't done that yet. It's below. |
Download the artifacts for this pull request: |
Feature: Auto-Assign Controllers
This PR introduces an auto-assigning controllers feature to Ryujinx, enhancing user experience by automatically detecting and assigning connected controllers to player slots. This streamlines the setup process, allowing users to start playing without manual configuration.
Changes & Enhancements:
Input
settings page now automatically refreshes when a controller is connected.Input
settings page to enable or disable the feature.Implementation Details:
Assignment Logic: Controllers are assigned sequentially, starting from Player 1.
Enable feature: The feature can be toggled on or off using a checkbox in the Input settings page. By default, it is disabled.
No Conflicts: This feature does not interfere with manual controller assignments, profile selection logic, or controller binding settings. It only modifies the configuration file when new controllers are connected.
No configuration loss: When controllers are disconnected, no controller configuration will be erased (unless manually deassigned using "Disabled").
Initial controller config: Since a configuration is necessary to successfully use a controller, this feature provides default controller configurations:
Ignore Applet: When the feature is enabled, it automatically enables the
Ignore Applet
setting and disables the checkbox, preventing it from being toggled on or off. This ensures seamless controller detection without applet interference.Why add this feature?
Manually assigning controllers can be cumbersome, especially in scenarios where users have multiple controllers or frequently connect/disconnect devices. This feature aims to simplify the setup process by automatically assigning controllers, saving time and reducing the hassle of manual configuration.
Known issues
File Organization
AutoAssignController.cs
(main class) andControllerAssignmentManager.cs
(helper class) are placed inRyujinx/Input
.Issues with Joy-Con Configurations
During testing to create default configurations for each controller, I encountered several issues with the Joy-Con controllers:
Controller Reassignment Bug (Unrelated to This PR)
This issue was encountered while testing, but I confirmed that it also occurs in the main Ryujinx repository. This is not caused by changes in this PR, but I am documenting it here in case anyone else encounters it (the same applies to the next issue).
Steps to Reproduce:
Expected Behavior: The controller should function normally after being reassigned.
Actual Behavior: The controller stops working after switching from “Disabled” back to an assigned controller.
Additional note: It appears to happen only when switching from 'Disabled' back to a controller
Crash on Game Relaunch (Unrelated to This PR)
Steps to Reproduce:
Expected Behavior: The game should start normally.
Actual Behavior: The emulator crashes on the "Loading" screen when attempting to restart the game.