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 | #ifndef __BUTTON_H__
|
| 8 | #define __BUTTON_H__
|
| 9 |
|
| 10 | #include "Buttons/Trigger.h"
|
| 11 | #include "Commands/Command.h"
|
| 12 |
|
| 13 | /**
|
| 14 | * This class provides an easy way to link commands to OI inputs.
|
| 15 | *
|
| 16 | * It is very easy to link a button to a command. For instance, you could
|
| 17 | * link the trigger button of a joystick to a "score" command.
|
| 18 | *
|
| 19 | * This class represents a subclass of Trigger that is specifically aimed at
|
| 20 | * buttons on an operator interface as a common use case of the more generalized
|
| 21 | * Trigger objects. This is a simple wrapper around Trigger with the method names
|
| 22 | * renamed to fit the Button object use.
|
| 23 | *
|
| 24 | * @author brad
|
| 25 | */
|
| 26 | class Button : public Trigger {
|
| 27 | public:
|
| 28 | virtual void WhenPressed(Command *command);
|
| 29 | virtual void WhileHeld(Command *command);
|
| 30 | virtual void WhenReleased(Command *command);
|
| 31 | };
|
| 32 |
|
| 33 | #endif
|