View Single Post
  #7   Spotlight this post!  
Unread 19-09-2015, 00:37
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Know a good Java library to read from a Gamepad or Joystick?

Quote:
Originally Posted by Maxwell777 View Post
Weird. I tried that in LWJGL, but it didn't work. I assumed it wouldn't work in JInput, but looks like it does.
Perhaps LWJGL is using an old version of JInput.

Quote:
Originally Posted by Maxwell777 View Post
How would you check if the controller has reconnected? Would the .poll work again?
I'm not sure. Why don't you try it?

Quote:
Originally Posted by Maxwell777 View Post
What if you connected a new joystick? How would you rebuild the list attached gamepads, if, say, you started the program and then connected a controller?
The GitHub version of JInput allows you to register listeners for controller state changes. That would probably be the most straight forward way.

I assume if JInput is able to fire events on controller state changes that it's also maintaining an updated list, but I haven't verified this.
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote