Jinput on OSX

I’ve tried to mix AWT and Jinput on OSX and got strange behaviour.
I use awt for keyboard and jiput for mouse control. The application works fine on Windows and Linux, but it behaves erratic on OSX.

On OSX I only get events from the keyboard sporadically and some events don’t even arrive at all ???

The application is very well behaved and sleeps 50 ms each update so it should not be a scheduling problem.

// Tomas

Since I didn’t get a reply on this one I will rephrase :wink:
Anybody successfully used jinput on OSX ?

The OS X port isn’t nearly as polished as the Linux/windows versions.

I have never used it in a serious application, I’ve only messed around with the various test apps and managed to tweak the code to get my game-pad recognized. I didn’t notice any severe problems with the keyboard, but I would not likely have noticed the issues you are seeing.

i’ve been working on getting JInput to work on OS X for a playstation 2 controller using a usb adapter. this works perfectly on the pc, but I’ve been having a great deal more difficulty getting it working properly on the Mac.

The issue I face now… I can find the controller “PSX/USB” in the controller environment, but I cannot seem to detect any axes on this controller. I think that the environment sees them, since it lists a number of buttons and whatnot when it finds the device (controller environment). However, when I try to assign the axes to an array, it ends up being zero length.

final Controller controller = controllers[index];
final Axis[] axis = new Axis[axes.length];

        for (int i=0;i< axes.length; i++) {
              axis[i] = axes[i];
        }
        System.out.println("# of axes ==> "+axis.length);
        for (int i=0;i<axis.length;i++) {
              System.out.println(axis[i].getName());
        }

Anybody have any ideas as to why this might be? Anyone successfully implemented a PS2 controller on a Mac with JInput?

thanks

If anyone is interested, I have an OSXJoystick implementation that works with the Logitech Extreme 3D. All 12 buttons, X, Y, RX, RY, Hat and Slider are recognized and accessible.

I still haven’t heard back on incorporating my OS X fixes back into CVS to fix the nightly build.

Did you make the request under cjcdoomed?

If not please email me what the name is that I shoudl approve at
jeffrey.kesselman@sun.com

[quote]i’ve been working on getting JInput to work on OS X for a playstation 2 controller using a usb adapter. this works perfectly on the pc, but I’ve been having a great deal more difficulty getting it working properly on the Mac.

The issue I face now… I can find the controller “PSX/USB” in the controller environment, but I cannot seem to detect any axes on this controller.

Anybody have any ideas as to why this might be? Anyone successfully implemented a PS2 controller on a Mac with JInput?

thanks
[/quote]
SOme controllers are composite cotrolelrs, their axes are actually on sub controllers.

To find out do a getControllers() omn the controller, it it does not return nul lthen it has sub scontrolelrs so repeat the process for each sub controller.

(Theoretically its can recurse indefinitely. In practice I have yet to find a controller that is more then one sub-controller deep, but you never know… )

Looking at the OSX controllers, it seems that mouse and keyboard are the only full functional implementations.

I’ve checked in a functional version of OSXJoystick modeled after OSXMouse and the joystick implementations on the other platforms.

I’ve got x axis, y axis, z axis, x rotational, y rotational, slider, hat and any number of buttons all working.

I tested this using a Logitech Extreme 3D.

I’ve just ordered the Logitech Rumblepad 2 Vibration Feedback Gamepad and once I’ve got a working OSXGamepad, I’ll check that in too.