Joystick / Gamepad Integration

Run TestJoyStick if you want to see how your joystick is reporting things. For joysticks that report their names nicely, we can even include mappings (even specific to your game) to map them to the standard buttons through a properties file.

As for how to map them to use in your game, my (somewhat biased) opinion is that you will have a much nicer time if you use the InputMapper that is built into Lemur. (You can use it without the rest of Lemur if you like… but it’s super useful.)

InputMapper is nice because it lets you treat joystick axes like any other button-based axes, mouse axes, etc. you can map them all to the same functions and your code doesn’t care. You can even scale them differently, etc…

You can see an example of this in the first Lemur Gem.

…which as I recall works out of the box with many standard game controllers as well as mouse/keyboard. All with the same handler code.

1 Like