MrStahlfelge / gdx-controllerutils

Controller Utilities for libGDX
Apache License 2.0
59 stars 13 forks source link

0.3.0 Incorrect Controller Detected #12

Closed Torbuntu closed 5 years ago

Torbuntu commented 5 years ago

My "Retrolink SNES Controller" is being detected as "Retrolink Saturn Classic Controller".

When I run the SDL2 Gamepad Tool I can see that the correct mapping exists:

"Retrolink SNES Controller", 03000000790000001100000010010000 (mapping available)

I searched the gamecontrollerdb.txt just to make sure, and it does in fact exist. line 533

Also, is there a gradle task for running the jamepad test app to debug locally?

Torbuntu commented 5 years ago

The gamecontrollerdb.txt is from an older version of Jamepad. I made a pull request to upgrade that version which should come with the updated controller mappings file.

MrStahlfelge commented 5 years ago

Yeah it's correct, the db is from an older version. It's not needed to update Jamepad to change the db, the file is included in resources. However, I am not sure if the file format is still the same. Please try it.

By the way, if your controller is detected, it will have a working mapping. The name is probably just an older named used to market the hardware.

Torbuntu commented 5 years ago

The mappings are unusable from the Saturn mappings.

I copy pasted the newest file into resources like you said and my own controller started working. I only have the one so I'm unsure if this would potentially break other mappings.

Summary: New file works for my project. However I don't know how to use it when developing locally and not in a release jar

Torbuntu commented 5 years ago

I found a way by just setting the newer txt file in my assets directory. So it now overrides the older one when I run local and when I deploy.

I guess this can be closed then since this solution is acceptable for my use case.

MrStahlfelge commented 5 years ago

By building an own local fork of this repo with your own controllerdb: https://github.com/MrStahlfelge/gdx-controllerutils#building-from-source

You can then submit a tested PR for the change, and I can test with my controllers.

However, even with the Jamepad DB you might have a user with a controller that has a wrong mapping. Consider using the core-mapping subproject to let the user make his own mapping. :)

Torbuntu commented 5 years ago

I'll look into the core mapping sub project :D thanks for all the help! Since I found what the problem was, and a way to resolve, I'll close this issue as solved.