Linux Gamepad Input on jme3-lwjgl Splits Input Between Two Logical Gamepads

The big two things is that it will display the output of each gamepad separately, and it will display the values of the axis and buttons in the GUI rather than just in the output log. The functionality is displayed in my utility (be sure to download the source itself and run it. The release is just the library and has no main method code). Give me a few minutes, and I’ll post the copy that I merged with TestJoystick.

Can not comment on the test as I have not tried joystick with JME but I think it can be in a separate PR from the “bumping jinput version” PR.

So you can go ahead and submit a PR for updating jinput version I believe.

2 Likes

Sorry it took so long (setting up a new computer, except that Ubuntu broke a couple times). I’ll do that now.

1 Like

Thanks

1 Like

To clarify: this PR hasn’t been merged for 3.4.0 (yet?), right?

1 Like

Also a couple of issues:


After calibration, I’m pressing the analog triggers (4 and 5) but they are not highlighted on the actual gamepad.


Here I’m holding the analog sticks “up” but they are showed as if I were holding them “down” (axis reversed). I’ve also attempted to calibrate it at “reverse” but the axis is still reversed.

Also got this when attaching the JoystickPreview appstate

java.lang.NullPointerException
	at markil3.controller.JoystickPreviewScreen.updateGamepad(JoystickPreviewScreen.java:606)
	at markil3.controller.JoystickPreviewScreen.initialize(JoystickPreviewScreen.java:590)
	at com.jme3.app.state.BaseAppState.initialize(BaseAppState.java:132)
	at com.jme3.app.state.AppStateManager.initializePending(AppStateManager.java:333)
	at com.jme3.app.state.AppStateManager.update(AppStateManager.java:363)
	at com.jme3.app.SimpleApplication.update(SimpleApplication.java:256)
	at com.jme3.system.lwjgl.LwjglWindow.runLoop(LwjglWindow.java:537)
	at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:626)
	at com.jme3.system.lwjgl.LwjglWindow.create(LwjglWindow.java:473)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:491)
	at com.jme3.app.LegacyApplication.start(LegacyApplication.java:443)
	at com.jme3.app.SimpleApplication.start(SimpleApplication.java:126)

EDIT: I guess that just attaching the app state isn’t enough. It needs the mapping file loaded or something, like is done on the example app.

Presumably joysticks were turned on in the app settings.

this PR hasn’t been merged for 3.4.0 (yet?), right?

PR 1454 was merged on 8 January, so it’s included in v3.4.0-stable. Is that the PR you were referring to?

I do still need to properly merge the jme3.4 branch of my project now that JME 3.4.0 has been released. I may do that over the weekend if I remember. However, you can probably still build it yourself.

1 Like

I just discovered that GLFW 3.3 has Gamepad input support GLFW: Input guide

by leveraging the SDL_GameControllerDB GitHub - gabomdq/SDL_GameControllerDB: A community sourced database of game controller mappings to be used with SDL2 Game Controller functionality

missing device support can be extended with open source tools GitHub - gabomdq/SDL_GameControllerDB: A community sourced database of game controller mappings to be used with SDL2 Game Controller functionality

and even with Steam big picture! GitHub - gabomdq/SDL_GameControllerDB: A community sourced database of game controller mappings to be used with SDL2 Game Controller functionality

So… what do we need to makes this work on JME, at least on a experimental level?

1 Like