marklovers / kaplay

🦖 A JavaScript game library
https://kaplayjs.com
MIT License
248 stars 17 forks source link

feat: unified input system and input bindings #142

Closed lajbel closed 3 weeks ago

lajbel commented 4 weeks ago

2 problems, now you have to hardcode input keys, for example

onKeyPress("space");

And also you have to implement two handlers for controllers and keyboard compatibility

onKeyPress("space", jump);
onGamepadButtonPress("dpad-up", jump)

So Write spec