public abstract class Button extends Trigger
Trigger.ButtonScheduler
Constructor and Description |
---|
Button() |
Modifier and Type | Method and Description |
---|---|
void |
cancelWhenPressed(Command command)
Cancel the command when the button is pressed
|
void |
toggleWhenPressed(Command command)
Toggles the command whenever the button is pressed (on then off then on)
|
void |
whenPressed(Command command)
Starts the given command whenever the button is newly pressed.
|
void |
whenReleased(Command command)
Starts the command when the button is released
|
void |
whileHeld(Command command)
Constantly starts the given command while the button is held.
|
cancelWhenActive, get, getSmartDashboardType, getTable, initTable, toggleWhenActive, whenActive, whenInactive, whileActive
public void whenPressed(Command command)
command
- the command to startpublic void whileHeld(Command command)
Command.start()
will be called repeatedly while the button is held,
and will be canceled when the button is released.command
- the command to startpublic void whenReleased(Command command)
command
- the command to startpublic void toggleWhenPressed(Command command)
command
- the command to startpublic void cancelWhenPressed(Command command)
command
- the command to startCopyright © 2015. All rights reserved.