AWT events or JInput?

Now I need to add user input (finally!) to my game, but I’m stuck trying to figure out exactly how much of JInput I actually need.

I’m going to need keyboard, mouse and joypad input eventually, but for now I only really need the keyboard (and possibly joypad to test how it works). Now since I’m using Jogl for my games display attaching a regular old KeyListener is a minimum amount of hastle and something that I know will reliably work. A few classes to handle the incomming up & down events into a set of boolean isPressed flags and I’m all set.

Obviously for joypad support I’m going to need JInput, and for the existing editor input I’m already using AWT mouse events, so I’m going to end up with both anyway.

But would JInput keyboard support gain me anything? I see it has the .isKeyPressed() written for me. While this is handy, I already have something that does this (and makes it easy to remap controls in the process). In switching to keyboard JInput, am i loosing compatability with any platforms?

Ooo, I also see a Rumbler interface, does this actually work? Would be nice to get feedback though my pad ;D

The JInput stuff is closer to the hardware and lower latency having queued input as mandated by the operating systems best available gaming APIs. It would be good for you to use it overall and give us some feedback if you come up with something you need added/changed - but I don’t think there is anything that you will be able to do in AWT that hasn’t already been addressed in JINput in some manner or other.

I’m not sure how important linux support is you, but since JInput doesn’t work on Linux 2.4.x I’d be keeping AWT events for now (if only as a choosable option).

Cheers,

Will.

Note: In the original Win32 release I didn’t have time to re-implement rumble under DX9.

It may still need a poke or two to get it functional on Wintel.

Hi
Depends on whether you want the keyboard mapped to the local mapping (ie, uk users with uk keyboard layouts), or wether you force it to US all the time (even if it’s say russian). The keyboard stuff isn’t that great if you ask me, it goes to a lower level, and under linux at least you don’t know what layout it is at that level (and it only works in 2.6 kernels unless it’s a USB keyboard). Mouse support still has some issues if you get the poll time wrong, I can regularly run the readtest application and clikc from window to window and see nothign happen in the mouse button window. On the birght side, unless you are an awkward sod and use a gamecube joypad (prod prod) then the gamepad/joystick support works well :slight_smile:

And yes, rumblers as still not functional, not sure about macos, but certainly linux and windows don’t support them yet.

Endolf