View Single Post
  #4   Spotlight this post!  
Unread 23-03-2014, 19:18
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: How to change command associated with button

Quote:
Originally Posted by MrRoboSteve View Post
one idea we were investigating was swapping the command associated with a button by calling WhenPressed() to replace the command bound to the button.
I tried to accomplish this (in java) by just creating a new button object and calling WhenPressed() on that new object when I wanted to change the command associated with a particular joystick button. It didn't really work out..and I couldn't really make sense of the behavior when testing. I didn't bother deleting (maybe java calls it disposing) the prior objects when creating new ones (since in java there is this magical thing called the garbage collector) but maybe that would have helped. My thread, http://www.chiefdelphi.com/forums/sh...d.php?t=127920 contains the code I tried to use. I think the ability clear the commands associated with a button would be a useful feature to add. Maybe I will get around to entering an artifact on the FIRST Forge project page
Reply With Quote