Code:
#includes stuff
class Robot: public frc::IterativeRobot
{
public:
bool shifter_varable = false; //shifter_varable = wasAPressed
DoubleSolenoid *shifter;
// other random decoration of other varables non
// robotInit, teleopInit, autonomousInit, autonomousPeriodic, etc
void teleopPeriodic() {
if (driver->GetRawButton(2)){
if (!shifter_varable){ // shifter_varable = wasAPressed
shifter_varable = true;
shifter->Set(shifter->Get() ==
DoubleSolenoid::Value::kReverse ?
DoubleSolenoid::Value::kForward :
DoubleSolenoid::Value::kReverse);
}else{
shifter_varable = false;
}
}
I copied your code and replaced wasAPressed to shifter_varable and.... it still did the same thing.

I think the Rio hates me
