feat: Support for Web
I am developing an app requiring web support for gamepads. I would like to contribute to this project. Please help review this pull request. Thanks!
@spydon @erickzanardo Any more suggestions?
Also this:
Because every version of gamepads_web from path depends on web >=0.1.0-beta which requires SDK version >=3.1.0-49.0.dev <4.0.0, gamepads_web from path is forbidden.
So the SDK has to be bumped to 3.4 everywhere, and then you can use web ^1.1.0 (And flutter has to be bumped accordingly).
Popping in to mention that there is a Github issue in this project associated with web support. I made a proof of concept for a web implementation earlier this year and I wouldn't consider web to be a stable platform for the purposes of this package, see comments on the issue.
https://github.com/flame-engine/gamepads/issues/32
Popping in to mention that there is a Github issue in this project associated with web support. I made a proof of concept for a web implementation earlier this year and I wouldn't consider web to be a stable platform for the purposes of this package, see comments on the issue.
I just ran a test on my Mac with 4 different USB Gamepads (Logitech Gamepad F310, cheap Nintendo NES like, Competition Pro USB, Hama Black Force).
- gamepads plugin v 0.1.4 detected: 2 / 4
- The Mac itself detected as Game Controller in Settings: 3 / 4
- https://hardwaretester.com/gamepad (Gamepad API) detected: 4 / 4
It also reported the events from the devices. Plug and Play in the Browser. Surprisingly, it just works.
I would also argue that all relevant features that game developers need are well established in the GamePad API, as shown here: https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API#browser_compatibility.
Therefore it would be really cool to see GamePad support for Flame moving forward on both Windows and on Web.
@zhuhaichao518 do you have any plans of finishing this up? :)
Oh, sure. I will work on this on this weekend. I am also investigating vibration and I wonder if anyone is working on it. :)
Lukas Klingsbo @.***>于2025年9月8日 周一23:18写道:
spydon left a comment (flame-engine/gamepads#48) https://github.com/flame-engine/gamepads/pull/48#issuecomment-3266809497
@zhuhaichao518 https://github.com/zhuhaichao518 do you have any plans of finishing this up? :)
— Reply to this email directly, view it on GitHub https://github.com/flame-engine/gamepads/pull/48#issuecomment-3266809497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM4EALHNHNKXA45TAV7BJLT3RWM6BAVCNFSM6AAAAACF5ZP5JOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTENRWHAYDSNBZG4 . You are receiving this because you were mentioned.Message ID: @.***>
Oh, sure. I will work on this on this weekend. I am also investigating vibration and I wonder if anyone is working on it. :)
Great to hear! Nobody is working on vibration as far as I know.
@spydon Hi, I'm not sure if any action is required to move to the next step. I see Because gamepads depends on gamepads_web any which doesn't exist (could not find package gamepads_web at https://pub.dev),/ version solving failed. in CI but I'm quite not familiar with this. :)
@zhuhaichao518 I pushed a commit to add it to the root pubspec, so you'll have to pull locally to get the latest.
@spydon Hi, there is still a format-check error from melos. I don't know what is the difference from formatting with melos and locally dart format.
@zhuhaichao518 it does the same thing, but you can run melos format locally if you want to be sure. Also make sure you're on Flutter ^3.35.
@zhuhaichao518 it does the same thing, but you can run
melos formatlocally if you want to be sure. Also make sure you're on Flutter ^3.35.
Hi, I run dart format . on Flutter 3.35.5 && Dart 3.9.2 • DevTools 2.48.0 but no format happened, which is different from CI: [gamepads_web]: Formatted lib/gamepads_web.dart. Would you please try format this file for me?
Hi, I run dart format . on Flutter 3.35.5 && Dart 3.9.2 • DevTools 2.48.0 but no format happened, which is different from CI: [gamepads_web]: Formatted lib/gamepads_web.dart. Would you please try format this file for me?
That's weird, I had no problems running dart format in it, pushed it as https://github.com/flame-engine/gamepads/pull/48/commits/3c0e9455b5a0e985d48c9cef9acf37b627696fd9
@markvideon @luanpotter could you give this a review too?