I would like to trigger the remapping of joysticks/gamepads in Lemur whenever a connect disconnect event happens. I saw that the InputMapper does have a protected mapper function for Joysticks, but bc it is protected and is called only in the initialize once I don’t see a good way to remap it. Does anybody have an idea how I could do that?
If I do not remapp it, I get tons Warnings that the Button has not mapping and I can’t use the new attached controller.
Nice. Yeah, I was going to suggest reflection as a short-term hack when I was reading the question.
It’s not really a good long-term solution. If JME provides a way to detect new joysticks then we should probably hook Lemur into that. Otherwise, making the refresh method public is probably not a bad idea.
Just use JoystickConnectionListener and you are settled. The lwjgl3 does call that and ofc my SdlJoyInput does as well. I just hooked my first menu App State to this listener and then get all joystick and call mapJoystick for every new joystick. So in theories it is there you just have to hook your InputMapper into this Listener and call the mapper on every connect and disconnect.
Me, too. I’m trying to get new versions of my packages out soon. Trying to get out from under some other things first and still need to wrap up some uncommitted changes to Lemur text component handling.
If you get bored and have the time, perhaps you can submit a PR for the joystick listener stuff?
Somehow I’m unable to upgrade the jme to 3.6.1-stable (currently it is 3.1.0-stable) in Lemur, it always tells me he doesn’t find it, but that I would need to make an auto-reload of joysticks on connect/disconnect events. It would be just a few lines of code