Files
allwpilib/wpilibc/src/generated/main/native/cpp/simulation/XboxControllerSim.cpp
2025-11-07 23:09:21 -08:00

98 lines
2.7 KiB
C++
Generated

// 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);
}