Gamepad mapping

20 views
Skip to first unread message

Mark Sibly

unread,
May 13, 2022, 10:46:48 PM5/13/22
to emscripten-discuss
Hi,

I recently found the gamepad button mapping is different between native and emscripten builds of my project.

The native build uses glfw to read gamepads, and I was originally hoping I could also use glfw for emscripten, but it turns out emscripten glfw doesn't support gamepads so I ended up using the html5 gamepad APIs on emscripten. Which works, but the buttons are mapped differently! For example, button(0) in html5 refers to a different button to button(0) in glfw.

It looks like both glfw and html5 APIs try to present a 'normalized' button mapping but they appear to be incompatible - has any one else had to deal with this?

Bye,
Mark

Reply all
Reply to author
Forward
0 new messages