1
Window / Re: joystick detection
« on: October 14, 2024, 03:30:02 pm »
I don't know which OS you are on, but at least for Windows SFML only detects new joysticks being plugged in when the window receives a WM_DEVICECHANGE event. sf::Joystick::update() doesn't look for new ones, it only updates the state of existing ones.
Window events are only received when you call the window's pollEvent() method. Since your code is busy looping waiting for a joystick, it will never poll for events and detect a joystick was added.
Window events are only received when you call the window's pollEvent() method. Since your code is busy looping waiting for a joystick, it will never poll for events and detect a joystick was added.