SFML community forums

General => Feature requests => Topic started by: TechRogue on November 18, 2013, 11:21:51 pm

Title: Joystick information
Post by: TechRogue on November 18, 2013, 11:21:51 pm
I'm working on a game that needs to support a few different types of gamepads all with different button configurations; button 0 (A) on the Xbox controller corresponds to X on the SNES controller and it's in a completely different place. I'm sure I don't need to go into too much detail on this matter as it's pretty well known that joysticks are utter chaos.

Is there a possibility that we'll see a function to get a string name or other sort of description for a given joystick ID? It would be really nice to be able to load set up buttons based on a named configuration file à la SDL2.
Title: AW: Joystick information
Post by: eXpl0it3r on November 19, 2013, 01:57:36 am
Maybe, you start by researching how to do handle the string/ID best.

Could you be more specific about the config file?
Title: Re: AW: Joystick information
Post by: zsbzsb on November 19, 2013, 02:19:35 am
Could you be more specific about the config file?

I do believe the config file he is talking about is something that is specific to his game. He defines a config file with default control mapping for specific joysticks names  ;)
Title: Re: Joystick information
Post by: Laurent on November 19, 2013, 07:38:28 am
Please search before posting.

https://github.com/SFML/SFML/issues/152

However this is not easy: so far I haven't succeeded to get a relevant name on Windows. All I got is "generic joystick" since almost all joysticks use the generic Windows driver. Getting the real name may involve more tricky manipulations with the registry.

No idea about Linux and OS X.
Title: Re: Joystick information
Post by: TechRogue on November 19, 2013, 03:10:11 pm
Eek, sorry. I did search the forums first but I forgot about the issue tracker.  :-[
Title: Re: Joystick information
Post by: Tenry on January 05, 2014, 05:15:34 pm
I am having the same issues and I found a nice website, that might help at least a little bit: http://pineight.com/mw/index.php?title=USB_game_controller
Title: Re: Joystick information
Post by: NoobsArePeople2 on January 07, 2014, 07:37:23 pm
Hey Guys,

I have a post (http://en.sfml-dev.org/forums/index.php?topic=14032.0) about this over in the Window sub forum. I've implemented the feature from the Github ticket Laurent referenced and would like to have some people test it out (specifically on Linux) before I submit a pull request.