JME Controller Config

In my never-ending quest to get gamepads functioning perfectly in my jMonkey game, I ended up creating a couple of utilities based on TestJoypad to make the task easier, as well as to crowdsource the work of getting all gamepads operation to the users. Considering that I find them fairly useful, I decided to extract them from my game and publish them as a standalone library on GitHub for anyone to use.

The library contains two application states of interest. The JoystickPreviewScreen state will display the controllers currently connected to the computer (and update it as controllers are connected and disconnected on properly configured applications), as well as the values of all their inputs. This is essentially a GUI-based, user-friendly enhancement to the original TestJoypad example that, in my opinion, makes debugging joysticks a lot easier.

Once you have an idea what is going on, you can then make changes. Version 1.1 introduces the CalibrateInputScreen state. This screen will show a series of prompts that will guide users through the process of creating a controller remapping properties file compatible with JoystickCompatibilityMappings. Once finished, it spits a configuration file to the location you specify (appending to any previous data if the file exists). You can then load up that configuration file in conjunction with the one that comes with jme3-core upon the next application run.

One of the main ideas behind this project was to utilize as few dependencies as possible. It does rely on slf4j for logging, but most of you will have that anyway. It also relies on the files in the Interface/Joystick folder of jme3-testdata. These can easily be copied over into your own resources folder in the same location. This doesn’t need any GUI libraries, so you can continue using whichever one you want (if any). All you need to do is attach the app states as needed and you are good to go.

I also included examples of how to implement the classes in the :desktop and :android subprojects in the GitHub project. These are fully-fledged projects that can run. If all you want is a standalone utility for development purposes, you can easily download the source and build them.


I made a few changes in the master branch of this project. I’m probably going to hold off of an actual release file, since many of the changes make heavy use of bleeding-edge jmonkey features I’ve been developing. Nevertheless, I do consider the master branch to be stable enough for production in 3.3 projects, should anyone care to build the library themselves.

Some highlights:

  • The remapper should handle trigger axes much better, even if the default value is not 0.
  • When remapping, users can now choose to disable any buttons that were not mapped. This should reduce the clutter of buttons that jmonkey doesn’t use (most often duplicate buttons).
  • The vertical axes of the joysticks should now reflect the actual input values better. There is still the issue of some gamepads sending inverted input, but that should hopefully be fixed in a later jmonkey update.
  • The default value shown for axes is now “0.0” rather than “-1.0.”

This looks like a very interesting addition, I did some related work with GitHub - Pesegato/BigBanana: Mouseless (bananaful?) navigation for jme3 applications