mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Prefix all NI DS specific controller classes (#8596)
Easier then the last one that put everything in a sub namespace. By prefixing the name less things break, and intellisense will be less confusing to new users during the transition.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/PS4Controller.hpp"
|
||||
#include "wpi/driverstation/NiDsPS4Controller.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,273 +13,262 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
PS4Controller::PS4Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "PS4Controller");
|
||||
NiDsPS4Controller::NiDsPS4Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsPS4Controller");
|
||||
}
|
||||
|
||||
double PS4Controller::GetLeftX() const {
|
||||
double NiDsPS4Controller::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double PS4Controller::GetLeftY() const {
|
||||
double NiDsPS4Controller::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double PS4Controller::GetRightX() const {
|
||||
double NiDsPS4Controller::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double PS4Controller::GetRightY() const {
|
||||
double NiDsPS4Controller::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
double PS4Controller::GetL2Axis() const {
|
||||
double NiDsPS4Controller::GetL2Axis() const {
|
||||
return GetRawAxis(Axis::kL2);
|
||||
}
|
||||
|
||||
double PS4Controller::GetR2Axis() const {
|
||||
double NiDsPS4Controller::GetR2Axis() const {
|
||||
return GetRawAxis(Axis::kR2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetSquareButton() const {
|
||||
bool NiDsPS4Controller::GetSquareButton() const {
|
||||
return GetRawButton(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetSquareButtonPressed() {
|
||||
bool NiDsPS4Controller::GetSquareButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetSquareButtonReleased() {
|
||||
bool NiDsPS4Controller::GetSquareButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kSquare);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Square(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Square(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetSquareButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCrossButton() const {
|
||||
bool NiDsPS4Controller::GetCrossButton() const {
|
||||
return GetRawButton(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCrossButtonPressed() {
|
||||
bool NiDsPS4Controller::GetCrossButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCrossButtonReleased() {
|
||||
bool NiDsPS4Controller::GetCrossButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCross);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Cross(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Cross(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCrossButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCircleButton() const {
|
||||
bool NiDsPS4Controller::GetCircleButton() const {
|
||||
return GetRawButton(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCircleButtonPressed() {
|
||||
bool NiDsPS4Controller::GetCircleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetCircleButtonReleased() {
|
||||
bool NiDsPS4Controller::GetCircleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCircle);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Circle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Circle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCircleButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTriangleButton() const {
|
||||
bool NiDsPS4Controller::GetTriangleButton() const {
|
||||
return GetRawButton(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTriangleButtonPressed() {
|
||||
bool NiDsPS4Controller::GetTriangleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTriangleButtonReleased() {
|
||||
bool NiDsPS4Controller::GetTriangleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTriangle);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Triangle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Triangle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTriangleButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL1Button() const {
|
||||
bool NiDsPS4Controller::GetL1Button() const {
|
||||
return GetRawButton(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL1ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetL1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL1ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetL1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL1);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::L1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::L1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL1Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR1Button() const {
|
||||
bool NiDsPS4Controller::GetR1Button() const {
|
||||
return GetRawButton(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR1ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetR1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR1ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetR1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR1);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::R1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::R1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR1Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL2Button() const {
|
||||
bool NiDsPS4Controller::GetL2Button() const {
|
||||
return GetRawButton(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL2ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetL2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL2ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetL2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL2);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::L2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::L2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL2Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR2Button() const {
|
||||
bool NiDsPS4Controller::GetR2Button() const {
|
||||
return GetRawButton(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR2ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetR2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR2ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetR2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR2);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::R2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::R2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR2Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetShareButton() const {
|
||||
bool NiDsPS4Controller::GetShareButton() const {
|
||||
return GetRawButton(Button::kShare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetShareButtonPressed() {
|
||||
bool NiDsPS4Controller::GetShareButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kShare);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetShareButtonReleased() {
|
||||
bool NiDsPS4Controller::GetShareButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kShare);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Share(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Share(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetShareButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetOptionsButton() const {
|
||||
bool NiDsPS4Controller::GetOptionsButton() const {
|
||||
return GetRawButton(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetOptionsButtonPressed() {
|
||||
bool NiDsPS4Controller::GetOptionsButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetOptionsButtonReleased() {
|
||||
bool NiDsPS4Controller::GetOptionsButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kOptions);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Options(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Options(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetOptionsButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL3Button() const {
|
||||
bool NiDsPS4Controller::GetL3Button() const {
|
||||
return GetRawButton(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL3ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetL3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetL3ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetL3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL3);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::L3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::L3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL3Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR3Button() const {
|
||||
bool NiDsPS4Controller::GetR3Button() const {
|
||||
return GetRawButton(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR3ButtonPressed() {
|
||||
bool NiDsPS4Controller::GetR3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetR3ButtonReleased() {
|
||||
bool NiDsPS4Controller::GetR3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR3);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::R3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::R3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR3Button(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetPSButton() const {
|
||||
bool NiDsPS4Controller::GetPSButton() const {
|
||||
return GetRawButton(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetPSButtonPressed() {
|
||||
bool NiDsPS4Controller::GetPSButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetPSButtonReleased() {
|
||||
bool NiDsPS4Controller::GetPSButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kPS);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::PS(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::PS(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetPSButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadButton() const {
|
||||
bool NiDsPS4Controller::GetTouchpadButton() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadButtonPressed() {
|
||||
bool NiDsPS4Controller::GetTouchpadButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadButtonReleased() {
|
||||
bool NiDsPS4Controller::GetTouchpadButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
BooleanEvent PS4Controller::Touchpad(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS4Controller::Touchpad(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTouchpadButton(); });
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpad() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS4Controller::GetTouchpadReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
void PS4Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsPS4Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "PS4");
|
||||
builder.PublishConstString("ControllerType", "NiDsPS4");
|
||||
builder.AddDoubleProperty("L2 Axis", [this] { return GetL2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("R2 Axis", [this] { return GetR2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/PS5Controller.hpp"
|
||||
#include "wpi/driverstation/NiDsPS5Controller.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,273 +13,262 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
PS5Controller::PS5Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "PS5Controller");
|
||||
NiDsPS5Controller::NiDsPS5Controller(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsPS5Controller");
|
||||
}
|
||||
|
||||
double PS5Controller::GetLeftX() const {
|
||||
double NiDsPS5Controller::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double PS5Controller::GetLeftY() const {
|
||||
double NiDsPS5Controller::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double PS5Controller::GetRightX() const {
|
||||
double NiDsPS5Controller::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double PS5Controller::GetRightY() const {
|
||||
double NiDsPS5Controller::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
double PS5Controller::GetL2Axis() const {
|
||||
double NiDsPS5Controller::GetL2Axis() const {
|
||||
return GetRawAxis(Axis::kL2);
|
||||
}
|
||||
|
||||
double PS5Controller::GetR2Axis() const {
|
||||
double NiDsPS5Controller::GetR2Axis() const {
|
||||
return GetRawAxis(Axis::kR2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetSquareButton() const {
|
||||
bool NiDsPS5Controller::GetSquareButton() const {
|
||||
return GetRawButton(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetSquareButtonPressed() {
|
||||
bool NiDsPS5Controller::GetSquareButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kSquare);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetSquareButtonReleased() {
|
||||
bool NiDsPS5Controller::GetSquareButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kSquare);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Square(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Square(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetSquareButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCrossButton() const {
|
||||
bool NiDsPS5Controller::GetCrossButton() const {
|
||||
return GetRawButton(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCrossButtonPressed() {
|
||||
bool NiDsPS5Controller::GetCrossButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCross);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCrossButtonReleased() {
|
||||
bool NiDsPS5Controller::GetCrossButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCross);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Cross(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Cross(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCrossButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCircleButton() const {
|
||||
bool NiDsPS5Controller::GetCircleButton() const {
|
||||
return GetRawButton(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCircleButtonPressed() {
|
||||
bool NiDsPS5Controller::GetCircleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCircle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCircleButtonReleased() {
|
||||
bool NiDsPS5Controller::GetCircleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCircle);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Circle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Circle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCircleButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTriangleButton() const {
|
||||
bool NiDsPS5Controller::GetTriangleButton() const {
|
||||
return GetRawButton(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTriangleButtonPressed() {
|
||||
bool NiDsPS5Controller::GetTriangleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTriangle);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTriangleButtonReleased() {
|
||||
bool NiDsPS5Controller::GetTriangleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTriangle);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Triangle(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Triangle(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTriangleButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL1Button() const {
|
||||
bool NiDsPS5Controller::GetL1Button() const {
|
||||
return GetRawButton(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL1ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetL1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL1ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetL1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL1);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::L1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::L1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL1Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR1Button() const {
|
||||
bool NiDsPS5Controller::GetR1Button() const {
|
||||
return GetRawButton(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR1ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetR1ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR1);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR1ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetR1ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR1);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::R1(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::R1(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR1Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL2Button() const {
|
||||
bool NiDsPS5Controller::GetL2Button() const {
|
||||
return GetRawButton(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL2ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetL2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL2ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetL2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL2);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::L2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::L2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL2Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR2Button() const {
|
||||
bool NiDsPS5Controller::GetR2Button() const {
|
||||
return GetRawButton(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR2ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetR2ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR2);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR2ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetR2ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR2);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::R2(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::R2(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR2Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCreateButton() const {
|
||||
bool NiDsPS5Controller::GetCreateButton() const {
|
||||
return GetRawButton(Button::kCreate);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCreateButtonPressed() {
|
||||
bool NiDsPS5Controller::GetCreateButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kCreate);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetCreateButtonReleased() {
|
||||
bool NiDsPS5Controller::GetCreateButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kCreate);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Create(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Create(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetCreateButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetOptionsButton() const {
|
||||
bool NiDsPS5Controller::GetOptionsButton() const {
|
||||
return GetRawButton(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetOptionsButtonPressed() {
|
||||
bool NiDsPS5Controller::GetOptionsButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kOptions);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetOptionsButtonReleased() {
|
||||
bool NiDsPS5Controller::GetOptionsButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kOptions);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Options(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Options(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetOptionsButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL3Button() const {
|
||||
bool NiDsPS5Controller::GetL3Button() const {
|
||||
return GetRawButton(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL3ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetL3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kL3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetL3ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetL3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kL3);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::L3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::L3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetL3Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR3Button() const {
|
||||
bool NiDsPS5Controller::GetR3Button() const {
|
||||
return GetRawButton(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR3ButtonPressed() {
|
||||
bool NiDsPS5Controller::GetR3ButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kR3);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetR3ButtonReleased() {
|
||||
bool NiDsPS5Controller::GetR3ButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kR3);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::R3(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::R3(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetR3Button(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetPSButton() const {
|
||||
bool NiDsPS5Controller::GetPSButton() const {
|
||||
return GetRawButton(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetPSButtonPressed() {
|
||||
bool NiDsPS5Controller::GetPSButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kPS);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetPSButtonReleased() {
|
||||
bool NiDsPS5Controller::GetPSButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kPS);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::PS(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::PS(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetPSButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadButton() const {
|
||||
bool NiDsPS5Controller::GetTouchpadButton() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadButtonPressed() {
|
||||
bool NiDsPS5Controller::GetTouchpadButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadButtonReleased() {
|
||||
bool NiDsPS5Controller::GetTouchpadButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
BooleanEvent PS5Controller::Touchpad(EventLoop* loop) const {
|
||||
BooleanEvent NiDsPS5Controller::Touchpad(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetTouchpadButton(); });
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpad() const {
|
||||
return GetRawButton(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadPressed() {
|
||||
return GetRawButtonPressed(Button::kTouchpad);
|
||||
}
|
||||
|
||||
bool PS5Controller::GetTouchpadReleased() {
|
||||
return GetRawButtonReleased(Button::kTouchpad);
|
||||
}
|
||||
|
||||
void PS5Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsPS5Controller::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "PS5");
|
||||
builder.PublishConstString("ControllerType", "NiDsPS5");
|
||||
builder.AddDoubleProperty("L2 Axis", [this] { return GetL2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("R2 Axis", [this] { return GetR2Axis(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/StadiaController.hpp"
|
||||
#include "wpi/driverstation/NiDsStadiaController.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,293 +13,270 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
StadiaController::StadiaController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "StadiaController");
|
||||
NiDsStadiaController::NiDsStadiaController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsStadiaController");
|
||||
}
|
||||
|
||||
double StadiaController::GetLeftX() const {
|
||||
double NiDsStadiaController::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double StadiaController::GetRightX() const {
|
||||
double NiDsStadiaController::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double StadiaController::GetLeftY() const {
|
||||
double NiDsStadiaController::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double StadiaController::GetRightY() const {
|
||||
double NiDsStadiaController::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
bool StadiaController::GetAButton() const {
|
||||
bool NiDsStadiaController::GetAButton() const {
|
||||
return GetRawButton(Button::kA);
|
||||
}
|
||||
|
||||
bool StadiaController::GetAButtonPressed() {
|
||||
bool NiDsStadiaController::GetAButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kA);
|
||||
}
|
||||
|
||||
bool StadiaController::GetAButtonReleased() {
|
||||
bool NiDsStadiaController::GetAButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kA);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::A(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::A(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetAButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetBButton() const {
|
||||
bool NiDsStadiaController::GetBButton() const {
|
||||
return GetRawButton(Button::kB);
|
||||
}
|
||||
|
||||
bool StadiaController::GetBButtonPressed() {
|
||||
bool NiDsStadiaController::GetBButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kB);
|
||||
}
|
||||
|
||||
bool StadiaController::GetBButtonReleased() {
|
||||
bool NiDsStadiaController::GetBButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kB);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::B(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::B(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetBButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetXButton() const {
|
||||
bool NiDsStadiaController::GetXButton() const {
|
||||
return GetRawButton(Button::kX);
|
||||
}
|
||||
|
||||
bool StadiaController::GetXButtonPressed() {
|
||||
bool NiDsStadiaController::GetXButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kX);
|
||||
}
|
||||
|
||||
bool StadiaController::GetXButtonReleased() {
|
||||
bool NiDsStadiaController::GetXButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kX);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::X(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::X(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetXButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetYButton() const {
|
||||
bool NiDsStadiaController::GetYButton() const {
|
||||
return GetRawButton(Button::kY);
|
||||
}
|
||||
|
||||
bool StadiaController::GetYButtonPressed() {
|
||||
bool NiDsStadiaController::GetYButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kY);
|
||||
}
|
||||
|
||||
bool StadiaController::GetYButtonReleased() {
|
||||
bool NiDsStadiaController::GetYButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kY);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Y(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Y(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetYButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperButton() const {
|
||||
bool NiDsStadiaController::GetLeftBumperButton() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperButtonPressed() {
|
||||
bool NiDsStadiaController::GetLeftBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperButtonReleased() {
|
||||
bool NiDsStadiaController::GetLeftBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::LeftBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::LeftBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftBumperButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperButton() const {
|
||||
bool NiDsStadiaController::GetRightBumperButton() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperButtonPressed() {
|
||||
bool NiDsStadiaController::GetRightBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperButtonReleased() {
|
||||
bool NiDsStadiaController::GetRightBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::RightBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::RightBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightBumperButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftStickButton() const {
|
||||
bool NiDsStadiaController::GetLeftStickButton() const {
|
||||
return GetRawButton(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftStickButtonPressed() {
|
||||
bool NiDsStadiaController::GetLeftStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftStickButtonReleased() {
|
||||
bool NiDsStadiaController::GetLeftStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftStick);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::LeftStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::LeftStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftStickButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightStickButton() const {
|
||||
bool NiDsStadiaController::GetRightStickButton() const {
|
||||
return GetRawButton(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightStickButtonPressed() {
|
||||
bool NiDsStadiaController::GetRightStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightStickButtonReleased() {
|
||||
bool NiDsStadiaController::GetRightStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightStick);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::RightStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::RightStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightStickButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetEllipsesButton() const {
|
||||
bool NiDsStadiaController::GetEllipsesButton() const {
|
||||
return GetRawButton(Button::kEllipses);
|
||||
}
|
||||
|
||||
bool StadiaController::GetEllipsesButtonPressed() {
|
||||
bool NiDsStadiaController::GetEllipsesButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kEllipses);
|
||||
}
|
||||
|
||||
bool StadiaController::GetEllipsesButtonReleased() {
|
||||
bool NiDsStadiaController::GetEllipsesButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kEllipses);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Ellipses(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Ellipses(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetEllipsesButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetHamburgerButton() const {
|
||||
bool NiDsStadiaController::GetHamburgerButton() const {
|
||||
return GetRawButton(Button::kHamburger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetHamburgerButtonPressed() {
|
||||
bool NiDsStadiaController::GetHamburgerButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kHamburger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetHamburgerButtonReleased() {
|
||||
bool NiDsStadiaController::GetHamburgerButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kHamburger);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Hamburger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Hamburger(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetHamburgerButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetStadiaButton() const {
|
||||
bool NiDsStadiaController::GetStadiaButton() const {
|
||||
return GetRawButton(Button::kStadia);
|
||||
}
|
||||
|
||||
bool StadiaController::GetStadiaButtonPressed() {
|
||||
bool NiDsStadiaController::GetStadiaButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kStadia);
|
||||
}
|
||||
|
||||
bool StadiaController::GetStadiaButtonReleased() {
|
||||
bool NiDsStadiaController::GetStadiaButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kStadia);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Stadia(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Stadia(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetStadiaButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightTriggerButton() const {
|
||||
bool NiDsStadiaController::GetRightTriggerButton() const {
|
||||
return GetRawButton(Button::kRightTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightTriggerButtonPressed() {
|
||||
bool NiDsStadiaController::GetRightTriggerButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightTriggerButtonReleased() {
|
||||
bool NiDsStadiaController::GetRightTriggerButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::RightTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::RightTrigger(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightTriggerButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftTriggerButton() const {
|
||||
bool NiDsStadiaController::GetLeftTriggerButton() const {
|
||||
return GetRawButton(Button::kLeftTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftTriggerButtonPressed() {
|
||||
bool NiDsStadiaController::GetLeftTriggerButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftTrigger);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftTriggerButtonReleased() {
|
||||
bool NiDsStadiaController::GetLeftTriggerButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::LeftTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::LeftTrigger(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftTriggerButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetGoogleButton() const {
|
||||
bool NiDsStadiaController::GetGoogleButton() const {
|
||||
return GetRawButton(Button::kGoogle);
|
||||
}
|
||||
|
||||
bool StadiaController::GetGoogleButtonPressed() {
|
||||
bool NiDsStadiaController::GetGoogleButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kGoogle);
|
||||
}
|
||||
|
||||
bool StadiaController::GetGoogleButtonReleased() {
|
||||
bool NiDsStadiaController::GetGoogleButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kGoogle);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Google(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Google(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetGoogleButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetFrameButton() const {
|
||||
bool NiDsStadiaController::GetFrameButton() const {
|
||||
return GetRawButton(Button::kFrame);
|
||||
}
|
||||
|
||||
bool StadiaController::GetFrameButtonPressed() {
|
||||
bool NiDsStadiaController::GetFrameButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kFrame);
|
||||
}
|
||||
|
||||
bool StadiaController::GetFrameButtonReleased() {
|
||||
bool NiDsStadiaController::GetFrameButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kFrame);
|
||||
}
|
||||
|
||||
BooleanEvent StadiaController::Frame(EventLoop* loop) const {
|
||||
BooleanEvent NiDsStadiaController::Frame(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetFrameButton(); });
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumper() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumper() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetLeftBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool StadiaController::GetRightBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
void StadiaController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsStadiaController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "Stadia");
|
||||
builder.PublishConstString("ControllerType", "NiDsStadia");
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
builder.AddDoubleProperty("RightX", [this] { return GetRightX(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftY", [this] { return GetLeftY(); }, nullptr);
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
#include "wpi/driverstation/NiDsXboxController.hpp"
|
||||
|
||||
#include "wpi/hal/UsageReporting.h"
|
||||
#include "wpi/util/sendable/SendableBuilder.hpp"
|
||||
@@ -13,237 +13,214 @@
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
XboxController::XboxController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "XboxController");
|
||||
NiDsXboxController::NiDsXboxController(int port) : GenericHID(port) {
|
||||
HAL_ReportUsage("HID", port, "NiDsXboxController");
|
||||
}
|
||||
|
||||
double XboxController::GetLeftX() const {
|
||||
double NiDsXboxController::GetLeftX() const {
|
||||
return GetRawAxis(Axis::kLeftX);
|
||||
}
|
||||
|
||||
double XboxController::GetRightX() const {
|
||||
double NiDsXboxController::GetRightX() const {
|
||||
return GetRawAxis(Axis::kRightX);
|
||||
}
|
||||
|
||||
double XboxController::GetLeftY() const {
|
||||
double NiDsXboxController::GetLeftY() const {
|
||||
return GetRawAxis(Axis::kLeftY);
|
||||
}
|
||||
|
||||
double XboxController::GetRightY() const {
|
||||
double NiDsXboxController::GetRightY() const {
|
||||
return GetRawAxis(Axis::kRightY);
|
||||
}
|
||||
|
||||
double XboxController::GetLeftTriggerAxis() const {
|
||||
double NiDsXboxController::GetLeftTriggerAxis() const {
|
||||
return GetRawAxis(Axis::kLeftTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftTrigger(double threshold, EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftTrigger(double threshold, EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this, threshold] { return this->GetLeftTriggerAxis() > threshold; });
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftTrigger(EventLoop* loop) const {
|
||||
return this->LeftTrigger(0.5, loop);
|
||||
}
|
||||
|
||||
double XboxController::GetRightTriggerAxis() const {
|
||||
double NiDsXboxController::GetRightTriggerAxis() const {
|
||||
return GetRawAxis(Axis::kRightTrigger);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightTrigger(double threshold, EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightTrigger(double threshold, EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this, threshold] { return this->GetRightTriggerAxis() > threshold; });
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightTrigger(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightTrigger(EventLoop* loop) const {
|
||||
return this->RightTrigger(0.5, loop);
|
||||
}
|
||||
|
||||
bool XboxController::GetAButton() const {
|
||||
bool NiDsXboxController::GetAButton() const {
|
||||
return GetRawButton(Button::kA);
|
||||
}
|
||||
|
||||
bool XboxController::GetAButtonPressed() {
|
||||
bool NiDsXboxController::GetAButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kA);
|
||||
}
|
||||
|
||||
bool XboxController::GetAButtonReleased() {
|
||||
bool NiDsXboxController::GetAButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kA);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::A(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::A(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetAButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetBButton() const {
|
||||
bool NiDsXboxController::GetBButton() const {
|
||||
return GetRawButton(Button::kB);
|
||||
}
|
||||
|
||||
bool XboxController::GetBButtonPressed() {
|
||||
bool NiDsXboxController::GetBButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kB);
|
||||
}
|
||||
|
||||
bool XboxController::GetBButtonReleased() {
|
||||
bool NiDsXboxController::GetBButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kB);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::B(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::B(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetBButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetXButton() const {
|
||||
bool NiDsXboxController::GetXButton() const {
|
||||
return GetRawButton(Button::kX);
|
||||
}
|
||||
|
||||
bool XboxController::GetXButtonPressed() {
|
||||
bool NiDsXboxController::GetXButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kX);
|
||||
}
|
||||
|
||||
bool XboxController::GetXButtonReleased() {
|
||||
bool NiDsXboxController::GetXButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kX);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::X(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::X(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetXButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetYButton() const {
|
||||
bool NiDsXboxController::GetYButton() const {
|
||||
return GetRawButton(Button::kY);
|
||||
}
|
||||
|
||||
bool XboxController::GetYButtonPressed() {
|
||||
bool NiDsXboxController::GetYButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kY);
|
||||
}
|
||||
|
||||
bool XboxController::GetYButtonReleased() {
|
||||
bool NiDsXboxController::GetYButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kY);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::Y(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::Y(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetYButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperButton() const {
|
||||
bool NiDsXboxController::GetLeftBumperButton() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperButtonPressed() {
|
||||
bool NiDsXboxController::GetLeftBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperButtonReleased() {
|
||||
bool NiDsXboxController::GetLeftBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftBumperButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperButton() const {
|
||||
bool NiDsXboxController::GetRightBumperButton() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperButtonPressed() {
|
||||
bool NiDsXboxController::GetRightBumperButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperButtonReleased() {
|
||||
bool NiDsXboxController::GetRightBumperButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightBumper(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightBumper(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightBumperButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetBackButton() const {
|
||||
bool NiDsXboxController::GetBackButton() const {
|
||||
return GetRawButton(Button::kBack);
|
||||
}
|
||||
|
||||
bool XboxController::GetBackButtonPressed() {
|
||||
bool NiDsXboxController::GetBackButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kBack);
|
||||
}
|
||||
|
||||
bool XboxController::GetBackButtonReleased() {
|
||||
bool NiDsXboxController::GetBackButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kBack);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::Back(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::Back(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetBackButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetStartButton() const {
|
||||
bool NiDsXboxController::GetStartButton() const {
|
||||
return GetRawButton(Button::kStart);
|
||||
}
|
||||
|
||||
bool XboxController::GetStartButtonPressed() {
|
||||
bool NiDsXboxController::GetStartButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kStart);
|
||||
}
|
||||
|
||||
bool XboxController::GetStartButtonReleased() {
|
||||
bool NiDsXboxController::GetStartButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kStart);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::Start(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::Start(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetStartButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftStickButton() const {
|
||||
bool NiDsXboxController::GetLeftStickButton() const {
|
||||
return GetRawButton(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftStickButtonPressed() {
|
||||
bool NiDsXboxController::GetLeftStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftStickButtonReleased() {
|
||||
bool NiDsXboxController::GetLeftStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftStick);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::LeftStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::LeftStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetLeftStickButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetRightStickButton() const {
|
||||
bool NiDsXboxController::GetRightStickButton() const {
|
||||
return GetRawButton(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightStickButtonPressed() {
|
||||
bool NiDsXboxController::GetRightStickButtonPressed() {
|
||||
return GetRawButtonPressed(Button::kRightStick);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightStickButtonReleased() {
|
||||
bool NiDsXboxController::GetRightStickButtonReleased() {
|
||||
return GetRawButtonReleased(Button::kRightStick);
|
||||
}
|
||||
|
||||
BooleanEvent XboxController::RightStick(EventLoop* loop) const {
|
||||
BooleanEvent NiDsXboxController::RightStick(EventLoop* loop) const {
|
||||
return BooleanEvent(loop, [this]() { return this->GetRightStickButton(); });
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumper() const {
|
||||
return GetRawButton(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumper() const {
|
||||
return GetRawButton(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperPressed() {
|
||||
return GetRawButtonPressed(Button::kRightBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetLeftBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kLeftBumper);
|
||||
}
|
||||
|
||||
bool XboxController::GetRightBumperReleased() {
|
||||
return GetRawButtonReleased(Button::kRightBumper);
|
||||
}
|
||||
|
||||
void XboxController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
void NiDsXboxController::InitSendable(wpi::util::SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("HID");
|
||||
builder.PublishConstString("ControllerType", "Xbox");
|
||||
builder.PublishConstString("ControllerType", "NiDsXbox");
|
||||
builder.AddDoubleProperty("LeftTrigger Axis", [this] { return GetLeftTriggerAxis(); }, nullptr);
|
||||
builder.AddDoubleProperty("RightTrigger Axis", [this] { return GetRightTriggerAxis(); }, nullptr);
|
||||
builder.AddDoubleProperty("LeftX", [this] { return GetLeftX(); }, nullptr);
|
||||
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS4ControllerSim.cpp
generated
Normal file
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS4ControllerSim.cpp
generated
Normal file
@@ -0,0 +1,105 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsPS4ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsPS4Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsPS4ControllerSim::NiDsPS4ControllerSim(const NiDsPS4Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsPS4ControllerSim::NiDsPS4ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(NiDsPS4Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetShareButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kShare, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void NiDsPS4ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(NiDsPS4Controller::Button::kTouchpad, value);
|
||||
}
|
||||
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS5ControllerSim.cpp
generated
Normal file
105
wpilibc/src/generated/main/native/cpp/simulation/NiDsPS5ControllerSim.cpp
generated
Normal file
@@ -0,0 +1,105 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsPS5ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsPS5Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsPS5ControllerSim::NiDsPS5ControllerSim(const NiDsPS5Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsPS5ControllerSim::NiDsPS5ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(NiDsPS5Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetCreateButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kCreate, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void NiDsPS5ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(NiDsPS5Controller::Button::kTouchpad, value);
|
||||
}
|
||||
101
wpilibc/src/generated/main/native/cpp/simulation/NiDsStadiaControllerSim.cpp
generated
Normal file
101
wpilibc/src/generated/main/native/cpp/simulation/NiDsStadiaControllerSim.cpp
generated
Normal file
@@ -0,0 +1,101 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsStadiaControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsStadiaController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsStadiaControllerSim::NiDsStadiaControllerSim(const NiDsStadiaController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsStadiaControllerSim::NiDsStadiaControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsStadiaController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kA, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kB, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kX, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kY, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kRightStick, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetEllipsesButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kEllipses, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetHamburgerButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kHamburger, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetStadiaButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kStadia, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetRightTriggerButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetLeftTriggerButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetGoogleButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kGoogle, value);
|
||||
}
|
||||
|
||||
void NiDsStadiaControllerSim::SetFrameButton(bool value) {
|
||||
SetRawButton(NiDsStadiaController::Button::kFrame, value);
|
||||
}
|
||||
89
wpilibc/src/generated/main/native/cpp/simulation/NiDsXboxControllerSim.cpp
generated
Normal file
89
wpilibc/src/generated/main/native/cpp/simulation/NiDsXboxControllerSim.cpp
generated
Normal file
@@ -0,0 +1,89 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/NiDsXboxControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/NiDsXboxController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
NiDsXboxControllerSim::NiDsXboxControllerSim(const NiDsXboxController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
NiDsXboxControllerSim::NiDsXboxControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftTriggerAxis(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightTriggerAxis(double value) {
|
||||
SetRawAxis(NiDsXboxController::Axis::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kA, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kB, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kX, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kY, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetBackButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kBack, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetStartButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kStart, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void NiDsXboxControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(NiDsXboxController::Button::kRightStick, value);
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/PS4ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/PS4Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
PS4ControllerSim::PS4ControllerSim(const PS4Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
PS4ControllerSim::PS4ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(PS4Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetShareButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kShare, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kTouchpad, value);
|
||||
}
|
||||
|
||||
void PS4ControllerSim::SetTouchpad(bool value) {
|
||||
SetRawButton(PS4Controller::Button::kTouchpad, value);
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/PS5ControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/PS5Controller.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
PS5ControllerSim::PS5ControllerSim(const PS5Controller& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
PS5ControllerSim::PS5ControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(14);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL2Axis(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kL2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR2Axis(double value) {
|
||||
SetRawAxis(PS5Controller::Axis::kR2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetSquareButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kSquare, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetCrossButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kCross, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetCircleButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kCircle, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetTriangleButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kTriangle, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL1Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kL1, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR1Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kR1, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL2Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kL2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR2Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kR2, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetCreateButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kCreate, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetOptionsButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kOptions, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetL3Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kL3, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetR3Button(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kR3, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetPSButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kPS, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetTouchpadButton(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kTouchpad, value);
|
||||
}
|
||||
|
||||
void PS5ControllerSim::SetTouchpad(bool value) {
|
||||
SetRawButton(PS5Controller::Button::kTouchpad, value);
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/StadiaControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/StadiaController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
StadiaControllerSim::StadiaControllerSim(const StadiaController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
StadiaControllerSim::StadiaControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(4);
|
||||
SetButtonsMaximumIndex(15);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(StadiaController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kA, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kB, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kX, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kY, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kRightStick, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetEllipsesButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kEllipses, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetHamburgerButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kHamburger, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetStadiaButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kStadia, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetRightTriggerButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetLeftTriggerButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetGoogleButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kGoogle, value);
|
||||
}
|
||||
|
||||
void StadiaControllerSim::SetFrameButton(bool value) {
|
||||
SetRawButton(StadiaController::Button::kFrame, value);
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
||||
|
||||
#include "wpi/simulation/XboxControllerSim.hpp"
|
||||
|
||||
#include "wpi/driverstation/XboxController.hpp"
|
||||
|
||||
using namespace wpi;
|
||||
using namespace wpi::sim;
|
||||
|
||||
XboxControllerSim::XboxControllerSim(const XboxController& joystick)
|
||||
: GenericHIDSim{joystick} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
XboxControllerSim::XboxControllerSim(int port) : GenericHIDSim{port} {
|
||||
SetAxesMaximumIndex(6);
|
||||
SetButtonsMaximumIndex(10);
|
||||
SetPOVsMaximumIndex(1);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftX(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightX(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftY(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightY(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftTriggerAxis(double value) {
|
||||
SetRawAxis(XboxController::Axis::kLeftTrigger, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightTriggerAxis(double value) {
|
||||
SetRawAxis(XboxController::Axis::kRightTrigger, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetAButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kA, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetBButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kB, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetXButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kX, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetYButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kY, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftBumperButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightBumperButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetBackButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kBack, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetStartButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kStart, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftStickButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftStick, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightStickButton(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightStick, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetLeftBumper(bool value) {
|
||||
SetRawButton(XboxController::Button::kLeftBumper, value);
|
||||
}
|
||||
|
||||
void XboxControllerSim::SetRightBumper(bool value) {
|
||||
SetRawButton(XboxController::Button::kRightBumper, value);
|
||||
}
|
||||
Reference in New Issue
Block a user