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 - Russo

Pages: [1]
1
Window / Re: Joystick input when out of focus
« on: November 14, 2020, 07:04:21 pm »
Does everything work as expected when the window has focus?

Also, what's your OS and joystick model? Version of SFML?

Yes, everything works fine on focus, but the goal of the application was to work on the background. I tried the SDL library and it has a function to fix this:
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");

Is there anything similar to that in SFML? I'm on Windows 10 using a Xbox One Controller, and SFML version is 2.5.1. Also I'm using MinGW

2
Window / Joystick input when out of focus
« on: November 13, 2020, 04:48:17 pm »
The function
sf::Joystick::isButtonPressed(joy, button)
was supposed to return the joystick input even when the window is out of focus, right? I'm asking because this doesn't seem to work for me. I tried using
sf::Joystick::update()
too, and it still doesn't work. I also tried using events and the result was the same (not surprisingly since events can only be handled by an active window as far as I know). Am I doing something wrong? Is there another way to get a joystick input when the window is out of focus?

Oh by the way I tried using the keyboard as well and it was fine, I could get the out of focus input. The only issue is the joystick.
sf::Keyboard::isKeyPressed(sf::Keyboard::Key::A)

Pages: [1]