HTML5 Gamepad API support in CocoonJS (Android, OUYA, NVIDIA Shield)

Ludei is happy to announce that from the release of the current version of CocoonJS (1.4.4) we have included support for the highly anticipated and repeatedly requested gamepad API support. The W3C has a work draft for a gamepad API specification. Modern desktop browsers are starting to support it (as usual, in their customized fashion way, check out Chrome and Firefox) but there is no trace of supporting it on mobile browsers so far (have checked on Chrome mobile and the NVIDIA Shield modified system browser, if I am wrong, please, let us know). Ludei’s gamepad API support is available for Android at the moment, but as Apple has released their gamepad API for iOS along with iOS 7, we are planning to support it soon (stay tuned!). But what does supporting the gamepad API mean?

* First of all, it means you can use the HTML5 gamepad API in your JavaScript code. You have it available in the CocoonJS Launcher App for Android by default from version 1.4.4+. For the cloud compiler, we have added an option check to add it.

* Android 4.0+ enabled devices have game controller support, so you will be able to connect a gamepad to your device and control your game with it.

* The OUYA console is an Android based system that got lot of attention thanks to their Kickstarter project. As a console for home/TV entertainment, it provides game controllers and as it is based on Android, Ludei is offering OUYA export/support thanks to the gamepad API.
* The NVIDIA Shield is a handheld console from NVIDIA that is also based on Android and thus, also supports game controllers thanks to the gamepad API.
Long story short, any Android device that can manage game controllers, will benefit from the CocoonJS acceleration, ease of export and now, the HTML5 gamepad API.

We are providing a new demo in our catalog (just available on the Android CocoonJS Launcher App) to show the basics on how to use the gamepad API. As with all the other demos, we provide the full source code of the demo. We also have added an optional CocoonJS extension file to provide with an easier way of accessing the buttons and axes in the gamepad API.

Also, please, check the gamepad extension checkbox on the CocoonJS cloud compiler. You can activate it for any Android compilation you make (for GooglePlay). We have also added a specific compilation for OUYA that automatically includes the gamepad API.

We are eager to see what you guys are able to do with this new feature/API. We think that HTML5 supporting gamepads is another step forward to show that web technology is ready for gaming. Ludei is doing its best to help make it a reality, specially on mobile.

And, hopefully soon… also available on iOS!!!


Some additional resources:

16 Comments HTML5 Gamepad API support in CocoonJS (Android, OUYA, NVIDIA Shield)

  1. Pingback: CocoonJS 1.4.4 | Ludei

  2. avatarBrent Hamel

    Stoked for the new Ouya update. I’m a Construct 2 user and I’ve noticed with my games I’ve tried on both my Ouya and my iPhone, that WebGL support is actually slower for me than Canvas2D… any ideas why that might be? I’m super stoked for CocoonJS to be the multi-platform wrapper its trying to be, but right now, it just can’t seem to allow my games (don’t know about other devs) to be fast enough yet… Not sure if this is something I’m doing on my end, or to do with the devices themselves (iPhone 4, Ouya) any ideas?

    1. avatarIker Jamardo

      Hello Brent, please contact us using and we will try to do our best to check what’s wrong. Definitively not all the Construct2 developers are facing these problems (more than 500 games have been published so far!).


  3. avatarNick Parde

    I have been trying to get the Gamepad to work on my Ouya. I am using Construct2, and I am finding that when I do a button press and hold, it will repeatedly send new button press commands, instead of just one. This is completely inconsistent with the same exported code in Chrome using a 360 controller. Is there any way to change this behavior, or is it a bug? It is currently similar to using ‘turbo’ on old NES / SNES controllers, which is undesired, and seems like a bug. Any ideas? Thanks for your help!

  4. avatarMichael Connolly

    I’m having the same problem as Nick. All instances of holding a button are treated as rapid-fire button presses.

  5. avatargta 5 money cheat 2014

    You can find some screens from the two modes of the open-world action-adventure title with
    the slideshow to the left of this article and the details below:.
    But in the case no results are visited within any time frame,
    stop driving the dimply skin treatment solution and shot something
    differing. ‘GTA 5’ could be getting a new DLC based
    on the jet pack in the near future.

  6. Pingback: Neues Update von CocoonJS bringt Gamepad-API-Support -

Leave a Reply to finscn Cancel reply

Your email address will not be published. Required fields are marked *