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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Monoking007

Pages: [1]
1
General / 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

2
Thank you! I will test it out and see if it works.

3
I'm trying to configure my controller to my program using the Joystick class for SFML 2.5.1 but no matter what number i use it still says it's not connected. the code i used to test the connection is

#include <SFML/Window/Joystick.hpp>
using namespace std;

int main()

{
   bool connected = sf::Joystick::isConnected(0);
   cout << connected << endl;
   }

Pages: [1]