Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Joystick information  (Read 5198 times)

0 Members and 1 Guest are viewing this topic.

TechRogue

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Joystick information
« 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Joystick information
« Reply #1 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: AW: Joystick information
« Reply #2 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  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Joystick information
« Reply #3 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.
Laurent Gomila - SFML developer

TechRogue

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Joystick information
« Reply #4 on: November 19, 2013, 03:10:11 pm »
Eek, sorry. I did search the forums first but I forgot about the issue tracker.  :-[

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Re: Joystick information
« Reply #5 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
Please note that my previous display name was "Shy Guy".

NoobsArePeople2

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Joystick information
« Reply #6 on: January 07, 2014, 07:37:23 pm »
Hey Guys,

I have a post 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.

 

anything