Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joystick events trigger when the SDL program has no focus #903

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Joystick events trigger when the SDL program has no focus #903

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Mac OS X 10.8, x86

Comments on the original bug report:

On 2013-06-04 17:14:07 +0000, Alex Szpakowski wrote:

Joystick and GameController input events appear to be generated even when the SDL program doesn't have regular input focus, which is not expected behaviour for me.

It would be nice for the Joystick/GameController input events to have an accompanying WindowID, but at the very least I think their input events should not be generated if no SDL window has keyboard focus. Adding a WindowID is not possible without breaking ABI compatibility with older SDL2 revisions.

Currently I can have 2 SDL2 programs open and joystick events will be generated for both at once no matter what has normal focus, unless the programs explicitly check for keyboard input focus when they receive the Joystick input events.

Tested on Mac OS 10.8.3.

On 2013-06-05 18:13:07 +0000, (disabled) Jørgen Tjernø wrote:

This should be fixed in http://hg.libsdl.org/SDL/rev/f7805b13b485 - no windowID for the time being, but SDL_GetKeyboardFocus can be used to figure out what window the user PROBABLY intended it for. :)

The old behavior of receiving all events can be returned by setting SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS to "1".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant