Gamepad in html5 (DEF-3931) (SOLVED)

Is there any way to make gamepad working in html5?

1 Like

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

2 Likes

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

2 Likes

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!

1 Like

Thank you all.
I will try to make native extension. Not sure how difficult it is but it sounds fun. Will keep you updated.

4 Likes

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.

Useful site https://html5gamepad.com

1 Like

I tested Xbox 360 Controller on windows in Chrome / Firefox / Microsoft Edge, works fine.

2 Likes

Dualshock 4 v2 working fine. Connection Bluetooth. Browsers: Latest Chrome and Safari.

3 Likes

Solved in 1.2.157 Defold 1.2.157 has been released

4 Likes