SFML community forums

Help => Graphics => Topic started by: LethalJam on March 21, 2016, 02:34:45 pm

Title: Joystick index not corresponding to correct gamepad
Post by: LethalJam 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.
Title: Re: Joystick index not corresponding to correct gamepad
Post by: Laurent 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")?