Skip to main content

Jinput-getting real-time Controller list

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
xerxes_is_kind
Offline
Joined: 2011-04-13

Hi all,
I am using the Jinput libraries to make use of a 3DMouse in an application. One problem I have come accross is that the ControllerEnvironment.getDefaultEnvironment() seems to only really work once. If the device is unplugged then I call this method and print out the list of controllers, it will work. however, if I plug the controller back in and call "ControllerEnvironment.getDefaultEnvironment()" to list the controllers, the controller that I just plugged in is not listed. Is this a bug? Is there any way I can get the real-time list of controllers plugged in? It's sounds so simple, but I have spent hours on this problem.
Thanks for your help!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
xerxes_is_kind
Offline
Joined: 2011-04-13

I have found a solution. you create an instance of DirectAndRawInputEnvironmentPlugin every time you want to know what is plugged in.