Hi,
I am using jinput in my game, but I have serious problems with it. I am trying to detect and use joystick , but a have few problems. First thing, on linux (Ubuntu Breezy Badger) when I list controllers I got just one controller, which is funny, because I got Keyboard, Mouse and Joystick attached to computer. But the real problem is when I try to find out if this controller is Joystick I cant really do it because getIdentifier for this controller returns Unknown (on windows it returns STICK identifier). I found out that this is Joystick by the number of axis and buttons, but I think this is very bad way to detect it.
Second problems is with Axes. I can’t detect axis right on linux. Here is how I do it:
joystick.getComponent(Identifier.Axis.X)
and I get null. On windows it works OK, I get X Axis.
So , on linux, the only thing I can do is to assume that first axes returned is X, second is Y, and third is Z. I don’t feel comfortable with this, because I am not sure if axes are always returned in this order,(on windows I get Z axes first.). getname method returns “X Axes” for all axes !!!
Ok, now let’s switch to windows. On windows, Jinput returns Keyboard, Mouse and Joystick controller, and I can detect Jostick by Identifier, so far everything is OK. Axis are also detected by Identifier:
joystick.getComponent(Identifier.Axis.X)
joystick.getComponent(Identifier.Axis.Y)
joystick.getComponent(Identifier.Axis.Z)
and it works fine.
The only problem I have on windows are buttons. Once again I can not access desired button by Idenifier, because for every button method getIdentifier returns Unknown. So I must assume that buttons are return in right order form getComponents method of the controller.
With all this said above, I have serious doubts on using JInput at all. Are there some plans to fix this issues soon?