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

Controller init too early on Mac OS 12.2.1 #263

Open
lsundman opened this issue Feb 15, 2022 · 1 comment
Open

Controller init too early on Mac OS 12.2.1 #263

lsundman opened this issue Feb 15, 2022 · 1 comment

Comments

@lsundman
Copy link

Hi!

I'm having a bit of trouble with the controller support on a Macbook Pro (2020, M1) with macOS Monterey (12.2.1). I compiled the master (this commit) from source with SDL2 2.0.20 installed from Homebrew.

For some reason the controller handling logic in input.cpp is executed a bit too early on my system.
SDL_NumJoysticks() just returns 0 when input_init is executed even though the controller is connected.

I'm guessing this is the problem since adding a short

case SDL_JOYDEVICEADDED:
    joy = SDL_JoystickOpen(0);

to the event loop in the function input_loop makes the controller work again with all mappings etc.
This loads the controller sometime during the intro.

I'm guessing this is some Mac-specific behaviour, since I don't remember having any problem with the same controller when compiling from source on Linux. 🙂

debug.log

@xordspar0
Copy link
Contributor

Reacting to joysticks being added after the game starts is probably a good idea in any case.

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

2 participants