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

Author Topic: SFML 2.5.1 Joystick isButtonPressed function  (Read 783 times)

0 Members and 1 Guest are viewing this topic.

Monoking007

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
SFML 2.5.1 Joystick isButtonPressed function
« on: May 29, 2019, 09:25:48 pm »
Hello!

I'm trying to get the program to read which button is being pressed but no matter what number I insert the result is always false. This is the code i am using.

   sf::Joystick::update();
      if (Joystick::isButtonPressed(0, 0))
      {
         cout << "yes" << endl;
}
      else
      {
         cout << "no" << endl;
      }

I am trying to test for the A button on an xbox 1 controller

also for the example program in the Joystick folder it picks up my right toggle stick as the U and V axis but in my personal program it says there is no V axis
« Last Edit: May 29, 2019, 09:30:44 pm by Monoking007 »

 

anything