I am trying to get a refresh button to reload a list of controllers however the hardware check is only preformed once no matter how many times I call it
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
This works fine the first time it is executed and even prints this into the console:
Jul 13, 2015 1:22:58 PM net.java.games.input.ControllerEnvironment log
INFO: Linux plugin claims to have found 2 controllers
These two controllers then are properly displayed in my list.
The issue is that this only runs once and never re-preforms the hardware scan thus not showing when a controller is disconnected. I have found a question very similar to this already here on stack overflow but I am not really sure how it works or if it works for linux.
Could someone please explain why getDefaultEnvironment() does not rerun and what is a simple way of forcing this?