WPILibC++  unspecified
Button.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2011-2018 FIRST. 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 the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include "Buttons/Trigger.h"
11 #include "Commands/Command.h"
12 
13 namespace frc {
14 
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  virtual void CancelWhenPressed(Command* command);
32  virtual void ToggleWhenPressed(Command* command);
33 };
34 
35 } // namespace frc
Definition: RobotController.cpp:14
virtual void ToggleWhenPressed(Command *command)
Toggle the specified command when the button is pressed.
Definition: Button.cpp:50
This class provides an easy way to link commands to OI inputs.
Definition: Button.h:26
virtual void WhenPressed(Command *command)
Specifies the command to run when a button is first pressed.
Definition: Button.cpp:17
virtual void WhenReleased(Command *command)
Specifies the command to run when the button is released.
Definition: Button.cpp:36
virtual void WhileHeld(Command *command)
Specifies the command to be scheduled while the button is pressed.
Definition: Button.cpp:27
virtual void CancelWhenPressed(Command *command)
Cancels the specificed command when the button is pressed.
Definition: Button.cpp:43
The Command class is at the very core of the entire command framework.
Definition: Command.h:48
This class provides an easy way to link commands to inputs.
Definition: Trigger.h:31