2021-08-14 20:00:46 +03:00
|
|
|
// 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.
|
|
|
|
|
|
2024-06-08 12:59:07 -04:00
|
|
|
// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
|
|
|
|
|
|
2021-08-14 20:00:46 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "frc/simulation/GenericHIDSim.h"
|
|
|
|
|
|
|
|
|
|
namespace frc {
|
|
|
|
|
|
|
|
|
|
class PS4Controller;
|
|
|
|
|
|
|
|
|
|
namespace sim {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class to control a simulated PS4 controller.
|
|
|
|
|
*/
|
|
|
|
|
class PS4ControllerSim : public GenericHIDSim {
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Constructs from a PS4Controller object.
|
|
|
|
|
*
|
|
|
|
|
* @param joystick controller to simulate
|
|
|
|
|
*/
|
|
|
|
|
explicit PS4ControllerSim(const PS4Controller& joystick);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructs from a joystick port number.
|
|
|
|
|
*
|
|
|
|
|
* @param port port number
|
|
|
|
|
*/
|
|
|
|
|
explicit PS4ControllerSim(int port);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the left X value of the controller's joystick.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetLeftX(double value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the left Y value of the controller's joystick.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
2024-06-08 12:59:07 -04:00
|
|
|
void SetLeftY(double value);
|
2021-08-14 20:00:46 +03:00
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the right X value of the controller's joystick.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
2024-06-08 12:59:07 -04:00
|
|
|
void SetRightX(double value);
|
2021-08-14 20:00:46 +03:00
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the right Y value of the controller's joystick.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetRightY(double value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the left trigger 2 axis on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetL2Axis(double value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the right trigger 2 axis on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetR2Axis(double value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the square button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetSquareButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the cross button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetCrossButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the circle button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetCircleButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the triangle button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetTriangleButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the left trigger 1 button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetL1Button(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the right trigger 1 button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetR1Button(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the left trigger 2 button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetL2Button(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the right trigger 2 button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetR2Button(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the share button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetShareButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the options button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetOptionsButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Change the value of the L3 (left stick) button on the controller.
|
|
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetL3Button(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Change the value of the R3 (right stick) button on the controller.
|
|
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetR3Button(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-06-08 12:59:07 -04:00
|
|
|
* Change the value of the PlayStation button on the controller.
|
2021-08-14 20:00:46 +03:00
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
void SetPSButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Change the value of the touchpad button on the controller.
|
|
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
2024-06-08 12:59:07 -04:00
|
|
|
void SetTouchpadButton(bool value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Change the value of the touchpad button on the controller.
|
|
|
|
|
*
|
|
|
|
|
* @param value the new value
|
|
|
|
|
*/
|
|
|
|
|
[[deprecated("Use SetTouchpadButton instead")]]
|
2021-08-14 20:00:46 +03:00
|
|
|
void SetTouchpad(bool value);
|
2024-06-08 12:59:07 -04:00
|
|
|
|
2021-08-14 20:00:46 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace sim
|
|
|
|
|
} // namespace frc
|