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

Gamepads broken in 1.38.22 #7840

Open
dos1 opened this Issue Jan 10, 2019 · 7 comments

Comments

Projects
None yet
4 participants
@dos1
Copy link

dos1 commented Jan 10, 2019

exception thrown: TypeError: Cannot read property 'length' of undefined
    at _emscripten_get_num_gamepads (http://localhost:8000/odglos.js:1:318521)
@juj

This comment has been minimized.

Copy link
Collaborator

juj commented Jan 10, 2019

Have you called emscripten_sample_gamepad_data() function? See #7673 and https://groups.google.com/d/msg/emscripten-discuss/khBHudPFtUA/lqHpVwvpBQAJ

@dos1

This comment has been minimized.

Copy link
Author

dos1 commented Jan 10, 2019

I should have said that I got that with SDL2 from emscripten-ports ;)

@Daft-Freak

This comment has been minimized.

Copy link
Contributor

Daft-Freak commented Jan 10, 2019

I just hit this myself. Looks like we need to call that in here and here.

dos1 added a commit to dos1/SDL2 that referenced this issue Jan 11, 2019

@dos1

This comment has been minimized.

Copy link
Author

dos1 commented Jan 11, 2019

emscripten-ports/SDL2@2092bef does help :)

@Daft-Freak

This comment has been minimized.

Copy link
Contributor

Daft-Freak commented Jan 14, 2019

Did you test it with a gamepad? (That's on a branch because I couldn't find one).

@Beuc

This comment has been minimized.

Copy link
Contributor

Beuc commented Jan 20, 2019

With or without the patch, I now get:

TypeError: JSEvents.lastGamepadState is undefined

I don't have time to track down right now, but I guess I'll have to.

(This is a quite ugly breakage, please consider a deprecation phase to avoid busting everybody's intermediate libs/frameworks, I see Godot seems also impacted godotengine/godot#25100 :/)

Daft-Freak added a commit to Daft-Freak/emscripten that referenced this issue Jan 21, 2019

Update SDL2 port
See emscripten-ports/SDL2@version_15...version_16. Just a few fixes, the most important being the one for emscripten-core#7840. (Otherwise you get an exception on `SDL_Init` with `SDL_INIT_GAMECONTROLLER`)

kripken added a commit that referenced this issue Jan 21, 2019

Update SDL2 port (#7906)
See emscripten-ports/SDL2@version_15...version_16. Just a few fixes, the most important being the one for #7840. (Otherwise you get an exception on SDL_Init with SDL_INIT_GAMECONTROLLER)
@Beuc

This comment has been minimized.

Copy link
Contributor

Beuc commented Jan 22, 2019

Did you test it with a gamepad? (That's on a branch because I couldn't find one).

I reproduced the first error in my FreeDink port. I could test the patch with a gamepad: things work as before, that is, the joystick gets initialized only once in a while (not sure where that comes from, SDL2 just returns 0 joystick found). But when it gets detected, it works.

I was about to check this other "JSEvents.lastGamepadState is undefined" error but now the OpenGL context doesn't start anymore... Wish me luck :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment