Looking for pointers for joystick/keys configuring + steering wheel support

I’ve added support for joystick in my lil start of the game (for planes) and was ridiculously easy (thx for the great TestJoystick and so on!).
Although I suspect not all joysticks behave the same way and therefore I should have an option to configure the joystick controlling, and therefore wondering how should I do that?
Should I have a listener that listens to all possible joystick actions and set my mappings accordingly, recording them in a property file or something? I’m kind of asking myself how I’d do it for key mappings too so broader than joystick question.

I see that the jme Joystick class has a rumble method. I’m guessing inputManager.getJoysticks()[joystickId].rumble(aFloat) would do the trick. Will have to wait to grab a joystick with such a functionality to test it. Looks yummy :).

Since I have cars (and hovers) in my game, I was wondering if it would be doable to control them using a steering wheel? “Additionally LWJGL provides access to controllers such as Gamepads, Steering wheel and Joysticks” makes me think it is doable but no idea where to go from there? Joystick was easy since jme did all the work for me there. Looking at jme code, it seems I’d have to modify a couple core classes… and implement the wheel stuff… definitively out of my league :D.

Was wondering, are there plans to add wheel steering control to jme is or is for way down the road? I get that you have loads on your plate already.
Using “only” gamedpads/joysticks/keyboard/mouse is already great, if no time.

I think the steering wheel will show up as a joystick just like a bunch of things (my drawing tablet shows up as a bunch of joysticks… but not for the drawing part but all of the other buttons and stuff).

There is already support in the joystick stuff for a properties file that remaps a particular type of joystick based on its name… assuming it bothers to name itself in the driver. There is the default one that JME includes but apps can have their own as long as they are named properly and on the classpath. The idea was to slowly build a database of remappings so that most joysticks “just work”.

Regardless of all of that, you might want to have a screen that lets the user pick what function they want associated with what button/axis. That would then remap the listeners in InputManager or something. This sort of UI is a considerable amount of work, though… but all games seem to have them in the end.

1 Like

“I think the steering wheel will show up as a joystick just like a bunch of things (my drawing tablet shows up as a bunch of joysticks”
O.o… but that is ubah!

Thanks a lot for your reply, pspeed, full of what I needed to know.

Gonna test the steering wheel and check back with remarks, in case it is useful.

I guess in the USB spec for joysticks they can have whatever named axes that they want. I even have some that report the same axes twice with slightly different names.

Hopefully the steering wheel picks a relatively standard one like z rotation or something.

1 Like

Hahaha, it works, as you said. I’m in awe :). Even the pedals are recognized :D. And it’s a pretty uncommon driving set.

Steering wheel seems to end up as a roll axe instead of yaw and buttons seem to be all over the place.

Posting the results on your joystick thread. I’ll try making a property file for it a lil later.

Neat.

There are some nice things about the USB joystick interface. Back in the day, supporting a bunch of different controllers was a real pain.