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".
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.
there is an example here (http://java-game-lib.svn.sourceforge.net/viewvc/java-game-lib/trunk/LWJGL/src/java/org/lwjgl/test/input/TestControllers.java?revision=3511&view=markup), maybe that will help.
Quote from: kappa on March 30, 2011, 18:52:36
there is an example here (http://java-game-lib.svn.sourceforge.net/viewvc/java-game-lib/trunk/LWJGL/src/java/org/lwjgl/test/input/TestControllers.java?revision=3511&view=markup), maybe that will help.
Well, no. Here's the output at the start program when i haven't pressed anything on my controller:
(http://img576.imageshack.us/img576/8633/copyof1294778499078.png)
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?