WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
frc::Trigger Class Referenceabstract

This class provides an easy way to link commands to inputs. More...

#include <Trigger.h>

Inheritance diagram for frc::Trigger:
frc::Sendable frc::Button frc::InternalButton frc::JoystickButton frc::NetworkButton

Public Member Functions

bool Grab ()
 
virtual bool Get ()=0
 
void WhenActive (Command *command)
 
void WhileActive (Command *command)
 
void WhenInactive (Command *command)
 
void CancelWhenActive (Command *command)
 
void ToggleWhenActive (Command *command)
 
void InitTable (std::shared_ptr< ITable > subtable) override
 Initializes a table for this sendable object. More...
 
std::shared_ptr< ITableGetTable () const override
 
std::string GetSmartDashboardType () const override
 

Protected Attributes

std::shared_ptr< ITablem_table
 

Detailed Description

This class provides an easy way to link commands to inputs.

It is very easy to link a polled input to a command. For instance, you could link the trigger button of a joystick to a "score" command or an encoder reaching a particular value.

It is encouraged that teams write a subclass of Trigger if they want to have something unusual (for instance, if they want to react to the user holding a button while the robot is reading a certain sensor input). For this, they only have to write the Trigger#Get() method to get the full functionality of the Trigger class.

Member Function Documentation

std::string Trigger::GetSmartDashboardType ( ) const
overridevirtual
Returns
the string representation of the named data type that will be used by the smart dashboard for this sendable

Implements frc::Sendable.

std::shared_ptr< ITable > Trigger::GetTable ( ) const
overridevirtual
Returns
the table that is currently associated with the sendable

Implements frc::Sendable.

void Trigger::InitTable ( std::shared_ptr< ITable subtable)
overridevirtual

Initializes a table for this sendable object.

Parameters
subtableThe table to put the values in.

Implements frc::Sendable.


The documentation for this class was generated from the following files: