Question about Java and Game Pad input.

Joined
Apr 18, 2004
Messages
29
There is a game I am planning on writing during the course of the year for a school project, and I was recommened to use Java. From what I can gather, it is fairly easy to get a hold of so I should be able to start programming relatively quickly.

However, before I start, I must know this information. I am going to be using game pads for this game. Is it possible for Java to read data from the parallel port and if so, how many ports are active for input. Also, is it possible to read data from a USB port.
In both cases mentioned, how is it possible to do this.
For the USB port I am planning on used a 2 PS2 to 1 USB connector and for the parallel port I will either be building an adapter for an SNES controller or just purchasing an appropriate game pad

I have consulted at least 10 Java books at a bookstore, some even particular to gaming and game design, and none of the mention any kind of peripheral input.

Thanks for any help that can be provided.
 
Regarding access to USB devices from Java, check out jUSB (javadocs). Regarding parallel port access, check out parport. He even has a simple joystick implementation already built. More generically, there is the Java Communications API, which doesn't ship with standard Java, but it is expected to become a standard extension.

I don't actually have any personal experience with any of these, but it definitely sounds like it will be possible and perhaps even quite easy to work with. If you're concerned about having to use 3rd-party libraries or non-standard "standard extensions", don't be. It's not hard at all to package them up with your completed program, though you will have to rely on online documentation in order to work with them.
 
You might want to take a look at the Lightweight Java Game Library. I haven't had a chance to try it myself yet, so I can't attest how good it is, but it does look like something you may find useful.

The Lightweight Java Game Library (LWJGL) is a solution aimed directly at professional and amateur Java programmers alike to enable commercial quality games to be written in Java. LWJGL provides developers access to high performance crossplatform libraries such as OpenGL (Open Graphics Library) and OpenAL (Open Audio Library) allowing for state of the art 3D games and 3D sound. Additionally LWJGL provides access to controllers such as Gamepads, Steering wheel and Joysticks. All in a simple and straight forward API.
 
Back
Top