Gdx controllers update for GWT/HTML5

Nex reported that the GWT/HTML5 version of gdx-invaders doesn’t compile anymore (among other GWT related things). I thus updated the controllers extension to include a stub implementation for the Controllers class. If your project has a desktop, Android and HTML5 version, and if you want to use the controllers extension, do the following:

  • To your core project, add “gdx-controllers.jar”
  • To your desktop project, add “gdx-controllers.jar”, “gdx-controllers-desktop.jar” and “gdx-controllers-desktop-natives.jar”
  • To your Android project, add “gdx-controllers.jar” and “gdx-controllers-android.jar”. Make sure both jars are checked in the Android project’s Order & Export dialog (Properties -> Java Build Path -> Order & Export)
  • To your HTML5 project, add “gdx-controllers.jar”, “gdx-controllers-sources.jar”, “gdx-controllers-gwt.jar” and “gdx-controllers-gwt-sources.jar”

You also need to add the following entry to your gwt.xml file of your HTML5 project:

2 thoughts on “Gdx controllers update for GWT/HTML5

  1. I followed this and everything compiled fine but I’m getting an exception error which states that my Array is empty. I’m pretty sure it’s referring to this:

    controller = Controllers.getControllers().first();

    for(Controller controller: Controllers.getControllers()) {

    Gdx.app.log(“Controllers: “, controller.getName());

    }

    My desktop version detects my DS4 controller fine. Do I need a specific controller for desktop? Does it only detect the OUYA controller?

  2. I have the exact same problem. Desktop (on linux) works fine with my X360 controller but in HTML getControllers() is empty. I’m using libgdx 1.0.

Leave a Reply

Your email address will not be published.