Joystick Axis Value Not Read by JInput Until It Is Moved At Least Once!?

Started by honeybadger, December 09, 2010, 13:44:03

Previous topic - Next topic

honeybadger

Hi guys,

Hope someone can help me out here...

I'm using a joystick to read the user input. The code looks something like this:

------

myValue = myJoystick.getAxisValue(0); //Where 0 is the axis id of the analog stick

------

The problem is, by default, "myValue" is always equals to "-1".

It is only when I move the stick AT LEAST ONCE will "myValue" reflect the true value of the controller axis.

Can anyone please tell me how I could get "myValue" to reflect the true axis value right from the start?

Thanks very much guys. Greatly appreciate your help!

PS:

I use the Controller class from "org.lwjgl.input.Controller".

Blu3

I'm experiencing the same problem. Ive tried several joysticks.
If i use JInput directly, it gives me the correct values at once so there's definately something wrong with LWJGL's classes.

Id' appreciate any help as well.

kappa


Blu3

Quote from: kappa on March 30, 2011, 18:52:36
there is an example here, maybe that will help.

Well, no. Here's the output at the start program when i haven't pressed anything on my controller:



It fires all events correctly but the axis values get initialized with -1. That's the same value for when i press left. Shouldn't it be 0?