• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modern (or at least still alive) Joystick library for Java?

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to interface to a neat new joystick with Java, and I'm not finding anything that is current. The best looking jar files are 'jinput' but that project is locked on Java.net, the url is https://jinput.dev.java.net/

It doesn't seem to have any active development, or support. Things like the "getting started" link get a 404.

There are assorted references that you can find by googling for "game" or Joystick API, but none seem current. There is even a fair amount of discussion of "standard Java Game API" with input devices, which sounds promissing, but I'm not finding where this standard API is documented, etc.

I can probably reverse engineer if from the C code I can find, but that feels like more work than I want, I really need to move onto the game coding.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, after not finding a lot of (any?) viable competitors, I did find some useful information in 'jinput' at
http://www.java-gaming.org/ including a good "getting started" thread.

The key concept is that the binary distribution includes some JNI code and matching DLL, .so or -osx.jnilibf files.
There seems to be a moderately active forum on java-gaming as well.
 
Joachim Rohde
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like JMonkey supports Joysticks. But I have no clue to what degree or what is working under the hood. See the discussion here: http://jmonkeyengine.org/groups/general-2/forum/topic/joystick-virbation/
Documentation seems to ... ehm... lacking: http://jmonkeyengine.org/javadoc/com/jme3/input/Joystick.html
Maybe you get something useful from the sources.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've written a small set of Java classes that I've used to teach myself jinput, and to test how my Logitech 3D joystick works. Its open source, and may be useful to some other beginner.
http://pfarrell.com/java/joysticklib.tar.gz

It was written using Netbeans, but should work with any setup that can use the ANT scripts.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic