2048 icon indicating copy to clipboard operation
2048 copied to clipboard

Added gamepad support

Open christianliebel opened this issue 9 years ago • 11 comments

Added support for gamepad input using the HTML5 Gamepad API (http://www.w3.org/TR/gamepad/). Works on current versions of Google Chrome, Mozilla Firefox, Microsoft Edge and Opera (http://caniuse.com/#feat=gamepad). Doesn’t affect browsers not offering gamepad support.

christianliebel avatar May 16 '15 10:05 christianliebel

@iirelu @gabrielecirulli Is anyone taking care of this?

christianliebel avatar Jul 03 '15 18:07 christianliebel

I think problem is that no one has a gamepad to test this.

sigod avatar Jul 07 '15 00:07 sigod

@sigod Hm… can’t you grab/borrow a cheap USB controller from somewhere? ;) Xbox 360/One and PlayStation controllers work too…!

christianliebel avatar Jul 07 '15 18:07 christianliebel

@chliebel I finally got gamepad...

Care to merge this changes into gh-pages branch into your fork? So, we will be able to test it on your GitHub Pages. You need to enable this in repository's options.

Sorry for really late response.

sigod avatar Oct 20 '15 18:10 sigod

@sigod Great news! I merged my changes into my gh-pages branch and published it. However, I currently don’t have my gamepad with me and won’t be able to check if it works as early as Wednesday.

Does it work for you? Under which circumstances does the TypeError you noted above occur?

christianliebel avatar Nov 02 '15 19:11 christianliebel

Under which circumstances does the TypeError you noted above occur?

After I connect gamepad and press any of ABXY buttons (doesn't react to any of other buttons). After this I get same error on page reload. And need to reopen tab to get it "working".

I noticed that checkButton accepts 13 as buttonId and then 15 that's when error occurs. I press only one button.

sigod avatar Nov 02 '15 22:11 sigod

Hi @sigod, as this PR has its first birthday tomorrow, I think it’s a good time to get this done. ;-) I updated the PR by including a sanity check and pushed a new gh-pages branch. Could you retest it? Thanks in advance!

christianliebel avatar May 15 '16 12:05 christianliebel

PR Birthday? :joy:

christoga avatar May 15 '16 13:05 christoga

@christoga Let’s celebrate. 🎉

christianliebel avatar May 15 '16 13:05 christianliebel

Celebrate! 🎉 😂 -

christoga avatar May 15 '16 18:05 christoga

This pull request is 4 years old !! Happy Birthday 🤣

simon511000 avatar Mar 16 '19 05:03 simon511000