LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::ButtonBase Class Referenceabstract

#include <buttonBase.hpp>

Inheritance diagram for okapi::ButtonBase:
okapi::AbstractButton okapi::ControllerInput< bool > okapi::ADIButton okapi::ControllerButton

Public Member Functions

 ButtonBase (bool iinverted=false)
 
bool isPressed () override
 Return whether the button is currently pressed.
 
bool changed () override
 Return whether the state of the button changed since the last time this method was called.
 
bool changedToPressed () override
 Return whether the state of the button changed to pressed since the last time this method was called.
 
bool changedToReleased () override
 Return whether the state of the button to not pressed since the last time this method was called.
 
- Public Member Functions inherited from okapi::AbstractButton
virtual ~AbstractButton ()
 
virtual bool controllerGet () override
 Get the sensor value for use in a control loop.
 

Protected Member Functions

virtual bool currentlyPressed ()=0
 

Protected Attributes

bool inverted {false}
 
bool wasPressedLast_c {false}
 
bool wasPressedLast_ctp {false}
 
bool wasPressedLast_ctr {false}
 

Detailed Description

Definition at line 11 of file buttonBase.hpp.

Constructor & Destructor Documentation

◆ ButtonBase()

okapi::ButtonBase::ButtonBase ( bool  iinverted = false)
explicit
Parameters
iinvertedWhether the button is inverted (true meaning default pressed and false meaning default not pressed).

Member Function Documentation

◆ changed()

bool okapi::ButtonBase::changed ( )
overridevirtual

Return whether the state of the button changed since the last time this method was called.

Implements okapi::AbstractButton.

◆ changedToPressed()

bool okapi::ButtonBase::changedToPressed ( )
overridevirtual

Return whether the state of the button changed to pressed since the last time this method was called.

Implements okapi::AbstractButton.

◆ changedToReleased()

bool okapi::ButtonBase::changedToReleased ( )
overridevirtual

Return whether the state of the button to not pressed since the last time this method was called.

Implements okapi::AbstractButton.

◆ currentlyPressed()

virtual bool okapi::ButtonBase::currentlyPressed ( )
protectedpure virtual

◆ isPressed()

bool okapi::ButtonBase::isPressed ( )
overridevirtual

Return whether the button is currently pressed.

Implements okapi::AbstractButton.

Member Data Documentation

◆ inverted

bool okapi::ButtonBase::inverted {false}
protected

Definition at line 42 of file buttonBase.hpp.

◆ wasPressedLast_c

bool okapi::ButtonBase::wasPressedLast_c {false}
protected

Definition at line 43 of file buttonBase.hpp.

◆ wasPressedLast_ctp

bool okapi::ButtonBase::wasPressedLast_ctp {false}
protected

Definition at line 44 of file buttonBase.hpp.

◆ wasPressedLast_ctr

bool okapi::ButtonBase::wasPressedLast_ctr {false}
protected

Definition at line 45 of file buttonBase.hpp.


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