1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// 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
#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);
/**
* Change the left X value of the controller's joystick.
*
* @param value the new value
*/
void SetLeftX(double value);
/**
* Change the left Y value of the controller's joystick.
*
* @param value the new value
*/
void SetLeftY(double value);
/**
* Change the right X value of the controller's joystick.
*
* @param value the new value
*/
void SetRightX(double value);
/**
* Change the right Y value of the controller's joystick.
*
* @param value the new value
*/
void SetRightY(double value);
/**
* Change the value of the left trigger 2 axis on the controller.
*
* @param value the new value
*/
void SetL2Axis(double value);
/**
* Change the value of the right trigger 2 axis on the controller.
*
* @param value the new value
*/
void SetR2Axis(double value);
/**
* Change the value of the square button on the controller.
*
* @param value the new value
*/
void SetSquareButton(bool value);
/**
* Change the value of the cross button on the controller.
*
* @param value the new value
*/
void SetCrossButton(bool value);
/**
* Change the value of the circle button on the controller.
*
* @param value the new value
*/
void SetCircleButton(bool value);
/**
* Change the value of the triangle button on the controller.
*
* @param value the new value
*/
void SetTriangleButton(bool value);
/**
* Change the value of the left trigger 1 button on the controller.
*
* @param value the new value
*/
void SetL1Button(bool value);
/**
* Change the value of the right trigger 1 button on the controller.
*
* @param value the new value
*/
void SetR1Button(bool value);
/**
* Change the value of the left trigger 2 button on the controller.
*
* @param value the new value
*/
void SetL2Button(bool value);
/**
* Change the value of the right trigger 2 button on the controller.
*
* @param value the new value
*/
void SetR2Button(bool value);
/**
* Change the value of the share button on the controller.
*
* @param value the new value
*/
void SetShareButton(bool value);
/**
* Change the value of the options button on the controller.
*
* @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);
/**
* Change the value of the PlayStation button on the controller.
*
* @param value the new value
*/
void SetPSButton(bool value);
/**
* Change the value of the touchpad button on the controller.
*
* @param value the new value
*/
void SetTouchpadButton(bool value);
/**
* Change the value of the touchpad button on the controller.
*
* @param value the new value
* @deprecated Use SetTouchpadButton instead. This function is deprecated for
* removal to make function names consistent to allow the HID classes to be
* automatically generated.
*/
[[deprecated("Use SetTouchpadButton instead")]]
void SetTouchpad(bool value);
};
} // namespace sim
} // namespace frc