keycodes icon indicating copy to clipboard operation
keycodes copied to clipboard

Gamepad API events

Open poirierlouis opened this issue 4 years ago • 3 comments

Gamepad API

Introducing gamepad events, I'll let pictures spoke for them self:

2021-07-24_keycode_gamepad-demo-index

2021-07-24_keycode_gamepad-demo-connected

2021-07-24_keycode_gamepad-demo-light-theme

I've tested it on Firefox, Chrome and Edge with success using an Xbox One Controller. Key events are ignored while at least one gamepad is connected.

This is still a draft as I await for your feedback and suggestions. Could someone with controllers of other vendors try this ?

Roadmap

  • [ ] Table should show gamepad buttons / axes when a gamepad is connected.
  • [ ] Verify responsiveness.
  • [ ] ...

Tests

  • [x] Xbox One controller
  • [ ] Xbox Series X controller
  • [ ] Dual Shock controller
  • [ ] Joy-con controller
  • [ ] ...

License

SVG comes from Gamepad W3C Editor's draft and is linked along with W3C license. Thanks @sgraham for the original asset.

@palashmon Eventually, is it ok to include my name with this contribution ? (see footer)

poirierlouis avatar Jul 24 '21 20:07 poirierlouis

thats cool

cabinfvr avatar Nov 07 '21 14:11 cabinfvr

man this is really cool! I'm sorry I didn't see this earlier! Will look a bit more into it

wesbos avatar Jan 11 '22 18:01 wesbos

Thanks, I figure I may have refactored too much code... I also noticed that you started a with-nextjs branch with React. If you feel this content is ok but need it on with-nextjs, I'd be more than happy to code it for React.

poirierlouis avatar Jan 21 '22 16:01 poirierlouis