Input related crash

A player of mine has reported an odd crash that I can’t make much of. It looks something like as if the mouse itself was null or something along those lines but that doesn’t really make sense.

Any ideas?

java.lang.NullPointerException
at net.java.games.input.RawMouse$Button.<init>(RawMouse.java:197)
at net.java.games.input.RawMouseInfo.createControllerFromDevice(RawMouseInfo.java:83)
at net.java.games.input.RawInputEnvironmentPlugin.createControllersFromDevices(RawInputEnvironmentPlugin.java:160)
at net.java.games.input.RawInputEnvironmentPlugin.enumControllers(RawInputEnvironmentPlugin.java:176)
at net.java.games.input.RawInputEnvironmentPlugin.<init>(RawInputEnvironmentPlugin.java:123)
at net.java.games.input.DirectAndRawInputEnvironmentPlugin.<init>(DirectAndRawInputEnvironmentPlugin.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:160)
at com.jme3.input.lwjgl.JInputJoyInput.loadJoysticks(JInputJoyInput.java:84)
at com.jme3.input.InputManager.<init>(InputManager.java:146)
at com.jme3.app.LegacyApplication.initInput(LegacyApplication.java:344)
at com.jme3.app.LegacyApplication.initialize(LegacyApplication.java:601)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:178)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
at java.lang.Thread.run(Thread.java:745)

This is on jme 3.1-beta2, Windows 10, joysticks disabled, and the user claims to not have anything other than a mouse, keyboard and a headset plugged in. He also says he has no mouse/keyboard related issues otherwise.

Well, the fun fact is:

But even when the user has no joysticks there should be no exception.

So your joysticks aren’t really disabled (It’s unrelated to that crash I guess, but just a hint).

And: This issue seems to happen from time to time:
see here

I think Gamepad :: The Count Lucanor General Discussions is helpful.

Can you maybe ask the user to launch the game with the mouse unplugged? :smiley: Here it seems that a “Corsair Gaming Scimitar RGB Mouse” lead to the problem, because it was attempted to be read as Controller or something.

"Something to add… I can plug the mouse back in while in the game and the mouse and controller both continue to work, but when I exit and relaunch with the mouse plugged in, the controller no longer works. "

Edit: ha, in the other links the crash is also due to a corsair mouse :smiley:

And for what it’s worth, that joystick code wouldn’t run if joysticks were disabled because of the null check… the constructor of InputManager is called with a null joystick object if they are disabled.

See here:

Which is typically set to true by default:

Which is only set false here if called by the application or the settings dialog:

So, I call “shenanigans” on the “joysticks are disabled” thing.

@pspeed @Darkchaos Hmm I guess you guys are right. We set up launch parameters via steamworks to toggle it and it must’ve gotten disabled on his build somehow.

Mystery solved :smiley:

Though it’s still a bit funny how fragile the input system is if it can’t handle no joysticks when they’re enabled.

It can handle them just fine. I have joysticks enabled by default in all of my apps and I only sometimes plug a joystick in.

The issue seems specific to this “mouse that acts like a joystick”, I guess. Maybe a bug in JInput.

1 Like