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

Author Topic: Joystick index not corresponding to correct gamepad  (Read 1185 times)

0 Members and 1 Guest are viewing this topic.

LethalJam

  • Guest
Joystick index not corresponding to correct gamepad
« on: March 21, 2016, 02:34:45 pm »
Hello, I've got a problem concerning the sf::Joystick component. It's a simple one: the index of the joysticks do not correspond corretly to the gamepads. I tried printing out a console message when a controller presses a button:

   for (unsigned int i = 0; i < 4; i++)
   {
      if (Joystick::isButtonPressed(i, 0))
         cout << "Gamepad " << i+1 << " connected" << endl << endl;
   }

Here already, the indexes are incorrect so it seems as though sfml is incorrectly maping the indexes of the gamepads. In that case, what can I do to fix this? I'm truly clueless at the moment and I haven't found any threads that seem to discuss or atleast give any answers to this problem.
Has anyone else experienced this issue and if so, how do you solve it?
Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Joystick index not corresponding to correct gamepad
« Reply #1 on: March 21, 2016, 06:09:36 pm »
What mapping does SFML give you, and what mapping would you expect (and why do you think it would be more "correct")?
Laurent Gomila - SFML developer