[Library] Gamepad Guesser Solution

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
GVovkiv
Party member
Posts: 686
Joined: Fri Jan 15, 2021 7:29 am

[Library] Gamepad Guesser Solution

Post by GVovkiv »

Hello there.
icon_200x200.png
icon_200x200.png (18.28 KiB) Viewed 2126 times
(This time even with icon!)

Sooo, I was thinking about (and even once asked here on forums) about guessing type of gamepad (even 3rd party gamepads) and showing correct icons to user.
And I started working on database (which itself based on SDL community database): https://github.com/Vovkiv/gamepads_types_database, a csv file were I assign gamepad type based on GUID and name of gamepads.

And for this database to be useful, you actually need some implementation, and so here it is: https://github.com/Vovkiv/gamepad_guesser_solution
If anyone want to try it out, please, do so and share feeback!
All details are in repo. And, also, note, to see all possible types look here: https://github.com/Vovkiv/gamepads_type ... file#types
If everything will work out fine, I will continue developing implementations for other engines (like Godot, which doesn't use SDL for inputs as of now, but uses SDL database for gamepads mappings)/frameworks

Note: once love will move to 12.0 (which should mean SDL3), this implementation might become less relevant/completely useless, since SDL 3 seems to introduce such functionality https://wiki.libsdl.org/SDL3/SDL_GamepadType
My solution still might give better/more accurate typing, easier to add new type to database, but until then, you could try my solution.

And, also, here quick demo:
screenshot_of_demo.png
screenshot_of_demo.png (25.29 KiB) Viewed 2126 times
GamepadGuesserSolutionDemo.love
(82.05 KiB) Downloaded 188 times
It is just packaged version of https://github.com/Vovkiv/gamepad_guess ... al_example, so for more details refer there. But in general: connect and disconnect gamepad to see any effects.
If you connect any official (or 3rd party) PlayStation gamepads PS4 blue cross will be visible, B red for any Nintendo gamepad (or 3rd party), A green for XBOX gamepads (or 3rd party) and for any other gamepads.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests