mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -4,128 +4,128 @@
|
||||
|
||||
#include "wpi/commands2/button/CommandGamepad.hpp"
|
||||
|
||||
using namespace frc2;
|
||||
using namespace wpi::cmd;
|
||||
|
||||
CommandGamepad::CommandGamepad(int port)
|
||||
: CommandGenericHID(port), m_hid{frc::Gamepad(port)} {}
|
||||
: CommandGenericHID(port), m_hid{wpi::Gamepad(port)} {}
|
||||
|
||||
frc::Gamepad& CommandGamepad::GetHID() {
|
||||
wpi::Gamepad& CommandGamepad::GetHID() {
|
||||
return m_hid;
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::SouthFace(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kSouthFace, loop);
|
||||
Trigger CommandGamepad::SouthFace(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kSouthFace, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::EastFace(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kEastFace, loop);
|
||||
Trigger CommandGamepad::EastFace(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kEastFace, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::WestFace(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kWestFace, loop);
|
||||
Trigger CommandGamepad::WestFace(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kWestFace, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::NorthFace(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kNorthFace, loop);
|
||||
Trigger CommandGamepad::NorthFace(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kNorthFace, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Back(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kBack, loop);
|
||||
Trigger CommandGamepad::Back(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kBack, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Guide(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kGuide, loop);
|
||||
Trigger CommandGamepad::Guide(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kGuide, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Start(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kStart, loop);
|
||||
Trigger CommandGamepad::Start(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kStart, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::LeftStick(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kLeftStick, loop);
|
||||
Trigger CommandGamepad::LeftStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kLeftStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::RightStick(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kRightStick, loop);
|
||||
Trigger CommandGamepad::RightStick(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kRightStick, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::LeftShoulder(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kLeftShoulder, loop);
|
||||
Trigger CommandGamepad::LeftShoulder(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kLeftShoulder, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::RightShoulder(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kRightShoulder, loop);
|
||||
Trigger CommandGamepad::RightShoulder(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kRightShoulder, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::DpadUp(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kDpadUp, loop);
|
||||
Trigger CommandGamepad::DpadUp(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kDpadUp, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::DpadDown(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kDpadDown, loop);
|
||||
Trigger CommandGamepad::DpadDown(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kDpadDown, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::DpadLeft(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kDpadLeft, loop);
|
||||
Trigger CommandGamepad::DpadLeft(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kDpadLeft, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::DpadRight(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kDpadRight, loop);
|
||||
Trigger CommandGamepad::DpadRight(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kDpadRight, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Misc1(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kMisc1, loop);
|
||||
Trigger CommandGamepad::Misc1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kMisc1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::RightPaddle1(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kRightPaddle1, loop);
|
||||
Trigger CommandGamepad::RightPaddle1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kRightPaddle1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::LeftPaddle1(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kLeftPaddle1, loop);
|
||||
Trigger CommandGamepad::LeftPaddle1(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kLeftPaddle1, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::RightPaddle2(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kRightPaddle2, loop);
|
||||
Trigger CommandGamepad::RightPaddle2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kRightPaddle2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::LeftPaddle2(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kLeftPaddle2, loop);
|
||||
Trigger CommandGamepad::LeftPaddle2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kLeftPaddle2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Touchpad(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kTouchpad, loop);
|
||||
Trigger CommandGamepad::Touchpad(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kTouchpad, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Misc2(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kMisc2, loop);
|
||||
Trigger CommandGamepad::Misc2(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kMisc2, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Misc3(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kMisc3, loop);
|
||||
Trigger CommandGamepad::Misc3(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kMisc3, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Misc4(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kMisc4, loop);
|
||||
Trigger CommandGamepad::Misc4(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kMisc4, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Misc5(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kMisc5, loop);
|
||||
Trigger CommandGamepad::Misc5(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kMisc5, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::Misc6(frc::EventLoop* loop) const {
|
||||
return Button(frc::Gamepad::Button::kMisc6, loop);
|
||||
Trigger CommandGamepad::Misc6(wpi::EventLoop* loop) const {
|
||||
return Button(wpi::Gamepad::Button::kMisc6, loop);
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::LeftTrigger(double threshold,
|
||||
frc::EventLoop* loop) const {
|
||||
wpi::EventLoop* loop) const {
|
||||
return Trigger(loop, [this, threshold] {
|
||||
return m_hid.GetLeftTriggerAxis() > threshold;
|
||||
});
|
||||
}
|
||||
|
||||
Trigger CommandGamepad::RightTrigger(double threshold,
|
||||
frc::EventLoop* loop) const {
|
||||
wpi::EventLoop* loop) const {
|
||||
return Trigger(loop, [this, threshold] {
|
||||
return m_hid.GetRightTriggerAxis() > threshold;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user