Hi
Started
joystick programming today.... I have some doubts..
1) I have discovered that some buttons of my wired X360 controller are
not detected as pressed (the buttons are LT and RT)...
sf::Joystick::getButtonCount is returning 10..... Using my generic usb gamepad getButtonCount returns 12 buttons (and they all count as pressed when I press them) ... is this a bug?
2) I´m getting some errors trying to get the joystick moved with the events system. This is my code:
sf::Event event;
while (window.pollEvent (event)) {
// Close window : exit
if (event.type == sf::Event::Closed)
window.close();
// HERE I want to know the joystick number, the axis, and the new position
if (event.type == sf::Event::JoystickMoved) {
// error: expected primary expression before ´.´ token
unsigned int njoy = sf::Event::JoystickMoveEvent.joystickId;
// trying this way.. error: invalid use of ´struct sf::Event::JoystickMoveEvent´
unsigned int njoy = event.JoystickMoveEvent.joystickId;
what is the correct way of getting the joy number, the axis moved, and the new position (using the event system) ?
win7 x64, codeblocks, sfml 2 updated
thanks