-
Notifications
You must be signed in to change notification settings - Fork 184
Steam Virtual Gamepad support / Steam Input sharing Device Info with SDL #1086
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
Steam Virtual Gamepad support / Steam Input sharing Device Info with SDL #1086
Conversation
Experimenting a way to add a hint for Button Labels. It should attempt to fix the Nintendo Layout issue when using a Nintendo Switch controller
What's up, why'd you close it? |
sorry, I was actually cleaning things up while I was working on improving controller slot logic. Let me try to restore pull request ASAP. |
This changes the way how a Controller will be prioritized. By default: it'll always prioritize based on Player 1. It should play nicely with Steam Deck's internal inputs when Steam Input is active
… same time. An attempt to remedy the Lightbar activation. While Player 2/3/4 will override the in-game lightbar event upon connection: it'll later revert back to the in-game event.
To avoid "the Controller is leaking" situation, there's now a Gamepad stat management that should reset Controller state based on connected controller.
Another attempt to fix the lightbar by redoing the controller state mangement. For some reason: the Lightbar gets disabled when a controller is already plugged prior to game launch. It reverts back to normal until the next game event.
Ultimately, I decided to move all Controller Hotplug changes to a separate branch (with it's own Pull Request, coming soon) for the time being, this will avoid conflicting with the work that was already done with Steam Virtual Gamepad. for this Pull Request: it'll be ready for review shortly. edit: ok, it is now ready for review. if this merge request gets accepted to the Master build: I might suggest updating PlayStation controller support and Input Remapper section on README.MD. |
To ensure all Hotplug-related changes don't accidentally get leftover: this commit will revert all the back back to the accidental removal of Button Label's note.
I finally got time to test it the behaviour didn't seem to change with Steam Deck when running it with Steam Input enabled.
As for Gaming Mode with the same controller:
|
I tested it on Windows first using GitHub Actions. even tho it actually works with my compiled build: the GitHub Action file doesn't work. I think GitHub Actions seems to pretend my changes do not exist, at all. I'm going to investigate why GitHub Action isn't looking for my chances. I'm starting to believe something went terribly wrong with my fork, and I might need to repair it (the nuclear option would be to delete my fork, refork and redo the pull request. to make it easier for @DeaTh-G and everyone: I compiled a Windows devbuild for everyone to test. Just unzip the file using 7zip or NanaZip and dragged the .exe file to your file. For Linux: this might involve extra steps. However, I already tested the Windows devbuild it on my end and it works as it should (edit: I also tested it on Linux via Flatpak, it also works properly). the alternative would be to download my fork, select https://drive.google.com/file/d/1mNr_WXOVuU-iQ0Kv1v1nMN7yTKCqIUSH/view?usp=sharing side-note: Even if you download it from there (and I make sure it has nothing but the .exe file only), it's still better to compile the build yourself. |
I found out the issue. For some reason: it's using the Main branch (and I mean, this repository ) and NOT the AL2009man fork's "SteamVirtualGamepad-Prompts" branch. This will explain why my Nintendo Switch controller is still following button labels and the Device Info still says "Xbox One" instead of "Xbox Wireless Controller" on the console...despite my build having no problem with it. I will have to find a way to remedy the issue in my end, the alternative would be to forward all the changes to the main branch for case of simplification |
While I watched for an unrelated GitHub Action issue to be solved: I needed to compile a Linux build myself in order to test it on Steam Deck (this took several hours to get it working). I will update the existing G-Drive link to include both Linux and Flatpak app/flatpak file who wanna test out...but I strongly suggest (and safer) building it thru my forked repository. This will remain the case until GitHub Action works properly for this Pull Request. I conducted a super quick test using Steam Deck, although: I don't have access to the console (it might be in use on Konsole, tho?), I can confirm a few things!
but due to the way how Steam Deck's onboard input system is handled (as it's considered to be "Player 1"): it'll try to look at Steam Deck first (will default to Xbox prompts) before PlayStation's turn. See the video below: 2025-03-11.9-45-46.PM.mp4This might be fine for those who who wanna skip straight to the game without needing to watch the bootup sequence... but those who are gonna be on the Installation step: they'll see the problem for at least 2-3 seconds before it disappears or the moment you press any Inputs. This issue is mostly fixed on #1188, where it'll attempt to prioritize "Player 1" to a PlayStation Controller and vice-versa, but this can be improved upon-- depending if it's needed.. |
Used your drive link, can confirm it PlayStation icon detection now behaves nicely with Steam Input enabled on the Steam Deck in both Desktop and Gaming Mode. |
|
since hedge-dev#1045 will include it: we're gonna get rid of it on this code section to avoid conflicts.
Based on @hyperbx's suggestions: It'll look for SDL's Controller Name as opposed to EInputDevice's naming scheme.
Now that SDL_GameControllerName handles Controller naming conventions, the hid.ccp portion of GetInputDeviceName is no longer needed.
quick note: if Version 1.0.3 is around the corner and this PR will be part of it: I strongly suggest updating portions of README.md regarding "PlayStation controller as an Xbox controller". instead: it should inform Steam client users two things:
|
to avoid conflictions with other PRs (hedge-dev#1086 and hedge-dev#1045): the remaining codebae was restore to how the master build look. the downside is that it makes it far harder to test it's behavior with Steam Input mode. but this is only temporarily until it gets added to the Master branch.
As I was working on #1045, I've been searching for a way to get SDL2 to handshake Steam Input. At first, I needed to put a SDL2.dll file.
but ultimately, with the help of GitHub's Pilot AI. I've been able to determine the problem. Turns out
SDL_GameControllerTypeForIndex(index)
is being used as opposed toreturn SDL_GameControllerGetType(controller)
. I might be wrong on this one.After swapping a few codes and new additions (which also helps prepare for improved Nintendo Switch controller support down in the line), I'm able to get Steam Input to handshake the game directly and will handle the Button prompt detection system. Going forward: if a player is using a Steam Deck, and they hook up with a PlayStation gamepad: the button prompts will be properly shown on screen. This also addresses #371
I already tested it on my end with Steam Input and without Steam Input on Windows 11. However: additional testing will be required before submitting for review, especially on Linux.
But, here's how this new code now functions when you set the .exe file as a non-Steam Shortcut and forcefully override Steam Input mode:
Sonic.s.Steam.Controller.has.been.Unleashed.mp4