this for some reason, may be it will be usefull
sf::RenderWindow mainWin(sf::VideoMode(800, 600), "JoySlime");
mainWin.setKeyRepeatEnabled(false);
mainWin.setFramerateLimit(240);
mainWin.setMouseCursorVisible(false);
mainWin.setJoystickThreshold(5);
sf::Event mwEvent;
and this is actually part with issue, it is wrapped in WHILE (mainWin.isOpen()), don't think this should be here
//main menu
//event handler
while (mainWin.pollEvent(mwEvent)) {
//close window
if (mwEvent.type == sf::Event::Closed) {
GameState.isInMenu = false;
mainWin.close();
}
//start new game while player press A (button 0) or SPACEBAR
if (mwEvent.joystickButton.button == 0 || mwEvent.key.code == sf::Keyboard::Space) {
GameState.isInMenu = false;
GameState.isInGame = true;
th_input.launch(); //thread that handle input while in game
mClock.restart();
}
}
as I sad, all this works almost write, but this axis issue...
also noticed that while cursor is over window, event.joystickbutton returns mouse coords... is it intended, or I do something wrong?