This is what happens if the window is in focus and I press a joystick button, then release it:
Input Detected
Event State: 1
Input Detected
Event State: 0
This is what happens if the window is out of focus:
Input Detected
Event State: 0
So it is detecting the button release, but not the button press.
I also have another application that reads keyboard events from another thread and injects them into SDL, which only seems to detect SDL_KEYUP events, not SDL_KEYDOWN events. So the problem exists elsewhere, but it’s easier to demonstrate with SDL_JOYBUTTONDOWN/SDL_JOYBUTTONUP.
You can enable joystick events when the program isn’t in focus with SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS. It’s disabled by default.On 2013-09-01, at 9:42 PM, tehcloud wrote:
It seems that SDL_JOYBUTTONDOWN events are not picked up when the window is out of focus.
This is what happens if the window is in focus and I press a joystick button, then release it:
Input Detected
Event State: 1
Input Detected
Event State: 0
This is what happens if the window is out of focus:
Input Detected
Event State: 0
So it is detecting the button release, but not the button press.
I also have another application that reads keyboard events from another thread and injects them into SDL, which only seems to detect SDL_KEYUP events, not SDL_KEYDOWN events. So the problem exists elsewhere, but it’s easier to demonstrate with SDL_JOYBUTTONDOWN/SDL_JOYBUTTONUP.