1

Im currently making a small game and I would like to include Ps4/xbox/gamepad controller support in it. I cannot seem to find many resources on how to actually implement this so I was wondering what the best way to do this would be in Java?

I have tried searching ways to do this, but again have not found anything useful.

Avi yi
  • 11
  • 1

1 Answers1

0

It seems that JInput - https://jinput.github.io/jinput/ - might help you with what you are trying to do. It looks a bit stale and I have not tried it, so I have no idea if it even works with modern Java.

In short, due to Java's cross-platform approach you are going to need a library that allows you to discover and use input devices on various platforms.

If you focus on Windows, you could access native Windows libraries, as explained e.g. in this question about Java and native Windows libraries.

If you want to create a web application, then with (quite) some work you could probably make use of the Gamepad API.

Miki
  • 7,052
  • 2
  • 29
  • 39