jerrym | f157933 | 2013-02-07 01:56:28 +0000 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/
|
| 2 | /* Copyright (c) FIRST 2011. All Rights Reserved. */
|
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */
|
| 4 | /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
| 5 | /*----------------------------------------------------------------------------*/
|
| 6 |
|
| 7 | #include "Button.h"
|
| 8 |
|
| 9 | /**
|
| 10 | * Specifies the command to run when a button is first pressed
|
| 11 | * @param command The pointer to the command to run
|
| 12 | */
|
| 13 | void Button::WhenPressed(Command *command) {
|
| 14 | WhenActive(command);
|
| 15 | }
|
| 16 |
|
| 17 | /**
|
| 18 | * Specifies the command to be scheduled while the button is pressed
|
| 19 | * The command will be scheduled repeatedly while the button is pressed and will
|
| 20 | * be canceled when the button is released.
|
| 21 | * @param command The pointer to the command to run
|
| 22 | */
|
| 23 | void Button::WhileHeld(Command *command) {
|
| 24 | WhileActive(command);
|
| 25 | }
|
| 26 |
|
| 27 | /**
|
| 28 | * Specifies the command to run when the button is released
|
| 29 | * The command will be scheduled a single time.
|
| 30 | * @param The pointer to the command to run
|
| 31 | */
|
| 32 | void Button::WhenReleased(Command *command) {
|
| 33 | WhenInactive(command);
|
| 34 | }
|