-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Sort Remaps by Connected Controller #16747
Sort Remaps by Connected Controller #16747
Conversation
Probably good to ping @warmenhoven too, in case there is some unforeseen complication in Apple land. |
Working off memory, this looks fine to me, the controller name on Apple should get picked up from the mfi api correctly. I won't have a chance to test it for the next week or so though. If people are itching to get this in more quickly than that, I don't need you to wait on me, I can test it when I'm back. |
This is amazing! I haven't had the time to test the implementation yet, but this could probably address a pretty ancient feature request of mine, dating back to 2019: #9012 |
If this does what I assume it does (i.e. use the controller name for the remap file), some consideration for 'sanitizing' the name may be in order, since it may contain reserved characters (i.e. For instance, the Xbox |
@cmitu, good catch and thank you for the advice! I've added sanitization to the device name and should resolve that concern. |
I think this will accommodate your feature request, even though the implementation is a bit different then how it was described. I would encourage you to give it a try and share any feedback you might have. Otherwise, I would consider this complete, as it is. |
@LibretroAdmin, thank you for the review -- I've resolved the requested changes. |
Anything needed on my part to get this moving? |
@LibretroAdmin any further changes needed? |
Hey, this is an awesome feature! I've been wanting RetroArch to support something like this for a long time, so I figured I'd test it out (in a clean install built from this PR on Windows, if that matters). Unfortunately, although saving remaps to the per-controller path seems to work fine, the remaps don't appear to load next time RA is started. Log files:
Just to be explicit, I had the same (single) controller connected for each run, which uses autoconfig Let me know if there's anything else I can do to help debug this, and thanks again for implementing this change! Also, two other bits of feedback (less urgent, please ignore if unwanted):
(I know these things are probably outside the scope of the PR, but I just wanted to write them down while I was thinking about them.) |
I hacked in some extra logging, and it looks like
It saves to the new path, just doesn't load from it. |
Moar logging. Seems
Not sure why though. I only have the one controller connected, and the autoconfig file loaded just fine: |
Always using
And also that |
@s3gfaultx any thoughts on the path issue? |
The path issue didn't affect me on Linux. I have a Windows machine to test on now, I'll take the feedback raised in this thread and get it all fixed up. Thanks for being gentle on me, there's a ton of code all over the place and I'm still getting up to speed with the architecture. |
I can also help with Windows testing if that's useful (feel free to ping me here). This is functionality that I would love to have, so I'd be happy to help. :) |
@s3gfaultx no worries! We very much appreciate the contribution and your continuing interest in seeing it through. |
@bcat, I just pushed some more changes -- seems to work with the limited testing I performed. I'm leaning on continuing to use the device name instead of VID/PID just for ease of identification when working directly with the filesystem. I don't have any devices in my possession that use the same name, but if you have some examples of this, I'll look into it further. I'd assume that any devices with the same name, likely are spoofing the same VID/PID anyways (counterfeit Xbox periperals, etc). |
Nice! I'll try and build/test over this weekend.
I want to verify I'm not mistaken, but one place I think the current approach will run into problems is Bluetooth dinput controllers controllers on Windows. IIRC, those currently all report the same This actually affects me as a real user. I have a Bluetooth 8BitDo M30 and N64 Modkit, both of which are perfect candidates for this new feature (since they have a physical layout sufficiently different from the RetroPad abstraction), but I suspect they'll end up being indistinguishable without VID/PID matching. |
The more I think about this, the more I wish the autoconfig mechanism itself were a little more flexible, since it already has flexible device matching logic that works reasonably well across all the various joypad drivers. More tightly integrating into the autoconfig layer might also help with the second point here regarding applying the mappings to the correct controller number regardless of the order in which controllers were connected. To be clear though, this might be scope creep for this particular PR, and I'm not saying the current approach is bad. Just brainstorming... :) |
That thead implies they use the same VID/PID and is the cause of the issue -- however, I did change the logic to use the display name in commit ce1d652 and should work with these controllers.
I have both of these controllers too, and they work in Linux -- perhaps you can test them for me in Windows. |
Sorry for the delay, real life got in the way. :) I'll build and retest on Windows this weekend. |
Okay, retested on Windows. Looking good!
Two other thoughts from a user perspective:
|
I'm happy to hear that it's working for you now -- thank you for your help testing. Once this is merged, I'll investigate improving the remapping experience across multiple devices in a new PR. |
Alright, with the paths fixed and the requested changes made, do we need any more testing and/or review? @LibretroAdmin @sonninnos @Ryunam |
* sort remaps by connected controller if option is enabled * ensure dir name is valid based on input device name * Fix comments * Fix forbidden mixed declarations and code * fixing build errors * fix additional build warning/error * Resolved code review change requests * Changed strlcat to strlcpy as per recommendation * Retrigger checks * Use proper path separator. * Ensure default value is toggled off. * Ensure that gamepad device name is valid.
Discovered a bug related to this. It's ignored when launching a rom through the command line on MacOS. I have not tested it on other platforms. #17321 |
Description
This pull request introduces a new feature to RetroArch that enables users to save remapped controls with different controllers. RetroArch will now sort and apply remap configurations based on the specific controller used. This ensures that users custom remaps are respected across different controllers, enhancing the overall gaming experience.
Note: By default, this feature is NOT enabled. Due to the new folder structure introduced, existing remap files will not be loaded once this feature is enabled without manually moving the existing remaps to the appropriate folders for each controller.
Key Features:
Controller-Specific Remap Saving: Users can save remap configurations for individual controllers, allowing for seamless transitions between different controllers without losing custom settings.
Automatic Sorting: RetroArch automatically sorts and applies the correct remap configuration based on the controller connected, ensuring consistent gameplay.
Improved User Experience: This feature eliminates the need for manual remap adjustments when switching controllers, providing a smoother and more personalized gaming experience.