Not seeing my gamepad

Hi,

Before I say anything else, I would like to say that this project is incredible. I am working on a team that may control a hovercraft via a joystick, and this is exactly what I needed. I see that it is very responsive, and I should be able to easily send the data straight to the craft via sockets.

Now on to my problem: I have a Gravis Gamepad Pro that I brought in from home. The computer sees the gamepad just fine. However, jinput only sees the mouse and keyboard (no gamepad!!). What can I do to troubleshoot a problem like this? Is this gamepad not acceptable? What gamepad do you recommend?

Again, this is just phenomenal. I am thrilled that this exists.

Clint

See if this demo works:
http://lwjgl.org/jnlp/lwjgl-demo.php/test.input.TestControllers

Unfortunately, I can’t run that program from here. I get an error (probably because of security here). Is there another way to debug this sort of problem? I will try that link when I get home to see if I have any luck there.

I put my code in exactly the way it says to in the “Getting Started” section. I only see mouse and keyboard for inputs. I have Mouse with x-axis, y-axis, button 0 and button 1. I have keyboard with 126 components. I have nothing else!

It is a USB gamepad. Could that be the problem?

Clint

Also of note: When I do:

Controller[] ca = ControllerEnvironment.getDefaultEnvironment().getControllers();

I get two devices found in the debugger (DIMouse (0) and DIKeyboard(1)). I may just need to try other gamepads, or I may need to try a different computer. I am running on Windows NT if that means anything. My gamepad is definitely there when I go to “Gaming Options” in the Control Panel.

I tried that demo on another computer, and it worked perfectly. Can I have the source code for that???

Clint

http://java-game-lib.svn.sourceforge.net/viewvc/java-game-lib/trunk/LWJGL/src/java/org/lwjgl/test/input/TestControllers.java?view=log&content-type=text%2Fvnd.viewcvs-markup&pathrev=HEAD

Note: It doesn’t use JInput directly. LWJGL uses some kind of JInput wrapper.

I´m on holiday atm, so I apologise for the late response.

What OS are you using?, which version of JInput?

If it´s Windows, check that dxdiags reports the controller happily. If it´s linux, check you have read access to the /dev/input/event* device node that represents the controller.

HTH

Endolf

P.S. It might be 48-72 hours before I next have net access.

Another demo is here. And the source for that is in the jinput cvs over at jinput.dev.java.net

That one is pure jinput, and should be up to date.

HTH

Endolf

Trying another joystick, I still get the same result (not showing the gamepad, but showing keyboard and mouse). However, it IS in the “Input” tab of the DirectX Diagnostic Tool. I see “Mouse”, “Keyboard”, and “SideWinder Joystick” all in the DirectX Diagnostic tool.

I am using Windows 2000.

The distribution was downloaded today, and it is named “jinput_combined_dist_latest”.

Thank you so much for the help and the awesome project. It’s incredible!

Clint

I got it working using the lwjgl library. You guys obviously know more about it than I do, but my guess is the problem with the jinput “getting started” section is there isn’t a mention of creating the controllers. In lwjgl, there is a create() method which creates my controllers.

I don’t know if a “create()” method exists for jinput or not, but either way, this library is now working for me (through lwjgl), and it’s just incredible.

Thanks again!!!

Clint

Hi

It sounds like I’ve broken something, the latest version of LWJGL is not using the latest version of JInput last time I checked (It’s not that old, but they don’t update it every single time JInput does).

JInput has no create method, you just call the getControllers method to get all the ones JInput knows about.

I have a hunch, but I’ll have to investigate, let me get back to you.

Cheers

Endolf

Hi

I can reproduce this now, fairly major screw up on my part I would say :), I’ll work on it this afternoon if all goes to plan.

Endolf

Hi

Looks like it was a build problem. I’ve updated the webstart demo and uploaded a new distribution here

That should work.

Let me know :slight_smile:

Endolf

Endolf, you are the man! I don’t know what sort of sorcery you are performing to do this, but the API is fantastic.

Clint

Hi

I wouldn’t go that far, but it’s always nice to hear when ones work is appreciated :).

I would like to say that there have been other participants in JInput. Including in no particular order, Michael Martak, Thomas Daniel, Jeff Kesselman, Gregory Pierce and Elias Naur.

Endolf