OK, now I get the input ...what I press on the controller. I can nicely use the rumblers. (though it shows I have 5 rumblers, but afaik my controller has only 2...whatever)
My (hopefully) last problem:
I repeatedly print which controllers my Programm can see.
It looks something like this:
1 2 3 4 5 6 7 8 9
| while (true) { Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers(); for (Controller cont : controllers) { System.out.println(cont.getName()); }
} |
The problem is when I unplug my gamepad it still appears in the list but can't be polled anymore(of course...its not there). When I replug it, it still can't be polled. As well its not found as a new one. The only thing I can do about this so far is restarting my programm.
Is there anything I can do about this? Am I doing something wrong? I don't want to have to restart my programm to find new gamepads, or a repluged one.