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

Can't use gamepad mappings with already connected joysticks #1996

Closed
racz16 opened this issue Nov 21, 2021 · 1 comment
Closed

Can't use gamepad mappings with already connected joysticks #1996

racz16 opened this issue Nov 21, 2021 · 1 comment
Assignees
Labels
bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse verified Reproduced or otherwise verified bugs
Projects
Milestone

Comments

@racz16
Copy link

racz16 commented Nov 21, 2021

If I plug in a joystick into the computer before I call the glfwInit function (for example I plug in before I start the application), GLFW doesn't assign a gamepad mapping to my joystick. If I'm correct, this is because in the function glfwInit, it detects the already connected joysticks in function _glfwPlatformInit, and after that it initializes the gamepad mappings in function _glfwInitGamepadMappings. This means that function findMapping won't find a mapping to any already connected joysticks. There are no errors and the joystick functions work, only the gamepad related functions don't. If I disconnect and then reconnect my joystick, it works fine.
I use GLFW 3.3.5, Windows 10 (19043) and I tested with 2 different joysticks, but based on the code it only depends on the order of the function calls and not on the different joysticks or operating systems.

@elmindreda elmindreda added input Keyboard, joystick or mouse Windows Win32 specific (not Cygwin or WSL) labels Nov 24, 2021
@elmindreda elmindreda self-assigned this Nov 24, 2021
@elmindreda elmindreda added bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs and removed Windows Win32 specific (not Cygwin or WSL) labels Nov 24, 2021
@elmindreda elmindreda added this to Urgent in Queue Nov 24, 2021
@elmindreda elmindreda added this to the 3.3.6 milestone Nov 24, 2021
elmindreda added a commit that referenced this issue Nov 25, 2021
Joysticks already connected when GLFW was initalized did not get gamepad
mappings applied to them.

Regression introduced by 74a8ba2.

This change was backported without taking into account that 3.3.x does
not have on-demand joystick init.

Fixes #1996
@elmindreda
Copy link
Member

Thank you for reporting this! It should be fixed now with bfd9eaf. This was a bug and fix specific to the 3.3-stable branch. Will do a 3.3.6 release as soon as possible.

swarnimarun pushed a commit to swarnimarun/glfw-meson that referenced this issue Jul 9, 2022
Joysticks already connected when GLFW was initalized did not get gamepad
mappings applied to them.

Regression introduced by 74a8ba2.

This change was backported without taking into account that 3.3.x does
not have on-demand joystick init.

Fixes glfw#1996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests input Keyboard, joystick or mouse verified Reproduced or otherwise verified bugs
Projects
Queue
Urgent
Development

No branches or pull requests

2 participants