Is there any way to make gamepad working in html5?
I assume you have to make an extension that wraps Gamepad API https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
Nice example of gamepad using on web: https://github.com/luser/gamepadtest and on-line demo: https://luser.github.io/gamepadtest/
I suppose we just need for call html5.run(get_my_nice_gamepad_state()) in our update() function
We should include HTML5 gamepad support in the engine, but until that time you suggestion of a native extension is a very good idea. Please make it and share!
Thank you all.
I will try to make native extension. Not sure how difficult it is but it sounds fun. Will keep you updated.
let me know please is there any progress on supporting HTML5 gamepad in Defold?
No, I’m afraid there’s no news regarding this. What is the current status of gamepad support for HTML5? Is there a single API agreed upon by the Google, Mozilla, Apple and Microsoft?
if check out Browser compatibility
looks like all modern desktop browsers support it. but dunno about single API to be honest.
I tested Xbox 360 Controller on windows in Chrome / Firefox / Microsoft Edge, works fine.