phoboslab / wipeout-rewrite

2.64k stars 212 forks source link

WASM support for Gamepad API #39

Open jonsage opened 1 year ago

jonsage commented 1 year ago

When playing in browser it would be great to have option to use a controller

https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API

GregLebreton commented 1 year ago

Wasm build with the sokol backend which doesn't handle joystick. He's actually looking for a way to make it ;)

chrislenz1990xD commented 6 months ago

Servus! First: thanks for all your work! This game's rewrite is amazing!

I still can't make my Xbox One controller work on the browser version. Are there still any bugs I maybe don't know about or hasn't the controller support been finished yet?

phoboslab commented 6 months ago

The work for controller support in the browser hasn't started :)

The easiest way to get this working, would be to use the JS Gamepad API and forward all inputs to WASM, similarly to how touch buttons are implemented here in JS and in C.