|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
InternalButton based on axis inputs
I remember seeing a team's nice InternalButton implementation that would take a GenericHID (or Joystick?), an exis specification, and a threshold, and produce a couple of InternalButton objects ; the idea being that commands could be trigger off the joystick (or DPAD) position.
I thought I had it safely squirreled away, but it's not coming up. Has anyone else seen this? Don't want to write something that's already out in the wild.... |
|
#2
|
||||||
|
||||||
|
Re: InternalButton based on axis inputs
Here it is in C++ http://www.chiefdelphi.com/forums/sh...29&postcount=6
|
|
#3
|
|||
|
|||
|
Re: InternalButton based on axis inputs
Here's a not-quite-generic version in Java, but could easily be modified to be generic to your needs:
https://github.com/frc1675/frc1675-2...PadButton.java edit: looking at it again, this is such a short class that "modifying it to your needs" is basically rewriting the class, haha. I also looked at the javadoc for InternalButton, and we didn't use this as one, but I'm pretty sure it could just extend InternalButton instead if you wanted access to setPressed(). Last edited by BigJ : 27-09-2013 at 10:34. |
|
#4
|
||||
|
||||
|
Re: InternalButton based on axis inputs
Thanks!
and the third answer from team 2168,very similar to both the above. https://gist.github.com/jcorcoran/5743806 comments are not quite right around the description of the constructor, but it's also nice to use. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|