Thursday, January 02, 2020

Reading PS4 controllers on a Raspberry Pi in Java

I recently had a go at trying to get a LibGDX to run on a Raspberry Pi.  Any project.  Unfortunately I failed.  (If you've succeeded, please let me know, but from what I could glean from googling, no-one has succeeded yet.).

So instead I tried to get some Java code working that could read PS4 controllers/gamepads on a Raspberry Pi.  My aim is to use the Pi as a mini-gaming-console, so I can keep it near our big TV and create some simple co-op games that I could play with my kids, rather than drag them over to a small laptop with its small screen.

And I succeeded!  By standing in the shoulders of giants (in this case, the JInput authors) and finding the native JInput modules compiled for AMD, it seems to work.

The repo is here: https://github.com/SteveSmith16384/jinputtest .  Currently only tested with PS4 gamepads.  Let me know if it works for you.

No comments: