WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
GamepadSim.hpp
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
8
9namespace wpi {
10
11class Gamepad;
12
13namespace sim {
14
15/**
16 * Class to control a simulated Gamepad controller.
17 */
18class GamepadSim : public GenericHIDSim {
19 public:
20 /**
21 * Constructs from a Gamepad object.
22 *
23 * @param joystick controller to simulate
24 */
25 explicit GamepadSim(const Gamepad& joystick);
26
27 /**
28 * Constructs from a joystick port number.
29 *
30 * @param port port number
31 */
32 explicit GamepadSim(int port);
33
34 /**
35 * Change the left X value of the controller's joystick.
36 *
37 * @param value the new value
38 */
39 void SetLeftX(double value);
40
41 /**
42 * Change the left Y value of the controller's joystick.
43 *
44 * @param value the new value
45 */
46 void SetLeftY(double value);
47
48 /**
49 * Change the right X value of the controller's joystick.
50 *
51 * @param value the new value
52 */
53 void SetRightX(double value);
54
55 /**
56 * Change the right Y value of the controller's joystick.
57 *
58 * @param value the new value
59 */
60 void SetRightY(double value);
61
62 /**
63 * Change the value of the left trigger axis on the controller.
64 *
65 * @param value the new value
66 */
67 void SetLeftTriggerAxis(double value);
68
69 /**
70 * Change the value of the right trigger axis on the controller.
71 *
72 * @param value the new value
73 */
74 void SetRightTriggerAxis(double value);
75
76 /**
77 * Change the value of the South Face button on the controller.
78 *
79 * @param value the new value
80 */
81 void SetSouthFaceButton(bool value);
82
83 /**
84 * Change the value of the East Face button on the controller.
85 *
86 * @param value the new value
87 */
88 void SetEastFaceButton(bool value);
89
90 /**
91 * Change the value of the West Face button on the controller.
92 *
93 * @param value the new value
94 */
95 void SetWestFaceButton(bool value);
96
97 /**
98 * Change the value of the North Face button on the controller.
99 *
100 * @param value the new value
101 */
102 void SetNorthFaceButton(bool value);
103
104 /**
105 * Change the value of the Back button on the controller.
106 *
107 * @param value the new value
108 */
109 void SetBackButton(bool value);
110
111 /**
112 * Change the value of the Guide button on the controller.
113 *
114 * @param value the new value
115 */
116 void SetGuideButton(bool value);
117
118 /**
119 * Change the value of the Start button on the controller.
120 *
121 * @param value the new value
122 */
123 void SetStartButton(bool value);
124
125 /**
126 * Change the value of the left stick button on the controller.
127 *
128 * @param value the new value
129 */
130 void SetLeftStickButton(bool value);
131
132 /**
133 * Change the value of the right stick button on the controller.
134 *
135 * @param value the new value
136 */
137 void SetRightStickButton(bool value);
138
139 /**
140 * Change the value of the right bumper button on the controller.
141 *
142 * @param value the new value
143 */
144 void SetLeftBumperButton(bool value);
145
146 /**
147 * Change the value of the right bumper button on the controller.
148 *
149 * @param value the new value
150 */
151 void SetRightBumperButton(bool value);
152
153 /**
154 * Change the value of the D-pad up button on the controller.
155 *
156 * @param value the new value
157 */
158 void SetDpadUpButton(bool value);
159
160 /**
161 * Change the value of the D-pad down button on the controller.
162 *
163 * @param value the new value
164 */
165 void SetDpadDownButton(bool value);
166
167 /**
168 * Change the value of the D-pad left button on the controller.
169 *
170 * @param value the new value
171 */
172 void SetDpadLeftButton(bool value);
173
174 /**
175 * Change the value of the D-pad right button on the controller.
176 *
177 * @param value the new value
178 */
179 void SetDpadRightButton(bool value);
180
181 /**
182 * Change the value of the Miscellaneous 1 button on the controller.
183 *
184 * @param value the new value
185 */
186 void SetMisc1Button(bool value);
187
188 /**
189 * Change the value of the Right Paddle 1 button on the controller.
190 *
191 * @param value the new value
192 */
193 void SetRightPaddle1Button(bool value);
194
195 /**
196 * Change the value of the Left Paddle 1 button on the controller.
197 *
198 * @param value the new value
199 */
200 void SetLeftPaddle1Button(bool value);
201
202 /**
203 * Change the value of the Right Paddle 2 button on the controller.
204 *
205 * @param value the new value
206 */
207 void SetRightPaddle2Button(bool value);
208
209 /**
210 * Change the value of the Left Paddle 2 button on the controller.
211 *
212 * @param value the new value
213 */
214 void SetLeftPaddle2Button(bool value);
215
216 /**
217 * Change the value of the Touchpad button on the controller.
218 *
219 * @param value the new value
220 */
221 void SetTouchpadButton(bool value);
222
223 /**
224 * Change the value of the Miscellaneous 2 button on the controller.
225 *
226 * @param value the new value
227 */
228 void SetMisc2Button(bool value);
229
230 /**
231 * Change the value of the Miscellaneous 3 button on the controller.
232 *
233 * @param value the new value
234 */
235 void SetMisc3Button(bool value);
236
237 /**
238 * Change the value of the Miscellaneous 4 button on the controller.
239 *
240 * @param value the new value
241 */
242 void SetMisc4Button(bool value);
243
244 /**
245 * Change the value of the Miscellaneous 5 button on the controller.
246 *
247 * @param value the new value
248 */
249 void SetMisc5Button(bool value);
250
251 /**
252 * Change the value of the Miscellaneous 6 button on the controller.
253 *
254 * @param value the new value
255 */
256 void SetMisc6Button(bool value);
257};
258
259} // namespace sim
260} // namespace wpi
Handle input from Gamepad controllers connected to the Driver Station.
Definition Gamepad.hpp:27
void SetLeftTriggerAxis(double value)
Change the value of the left trigger axis on the controller.
void SetDpadRightButton(bool value)
Change the value of the D-pad right button on the controller.
void SetDpadLeftButton(bool value)
Change the value of the D-pad left button on the controller.
void SetRightBumperButton(bool value)
Change the value of the right bumper button on the controller.
void SetBackButton(bool value)
Change the value of the Back button on the controller.
void SetDpadUpButton(bool value)
Change the value of the D-pad up button on the controller.
void SetLeftBumperButton(bool value)
Change the value of the right bumper button on the controller.
void SetLeftPaddle2Button(bool value)
Change the value of the Left Paddle 2 button on the controller.
GamepadSim(int port)
Constructs from a joystick port number.
void SetMisc1Button(bool value)
Change the value of the Miscellaneous 1 button on the controller.
GamepadSim(const Gamepad &joystick)
Constructs from a Gamepad object.
void SetMisc3Button(bool value)
Change the value of the Miscellaneous 3 button on the controller.
void SetTouchpadButton(bool value)
Change the value of the Touchpad button on the controller.
void SetLeftY(double value)
Change the left Y value of the controller's joystick.
void SetRightPaddle2Button(bool value)
Change the value of the Right Paddle 2 button on the controller.
void SetMisc5Button(bool value)
Change the value of the Miscellaneous 5 button on the controller.
void SetRightStickButton(bool value)
Change the value of the right stick button on the controller.
void SetSouthFaceButton(bool value)
Change the value of the South Face button on the controller.
void SetRightY(double value)
Change the right Y value of the controller's joystick.
void SetLeftStickButton(bool value)
Change the value of the left stick button on the controller.
void SetMisc2Button(bool value)
Change the value of the Miscellaneous 2 button on the controller.
void SetRightPaddle1Button(bool value)
Change the value of the Right Paddle 1 button on the controller.
void SetEastFaceButton(bool value)
Change the value of the East Face button on the controller.
void SetWestFaceButton(bool value)
Change the value of the West Face button on the controller.
void SetMisc6Button(bool value)
Change the value of the Miscellaneous 6 button on the controller.
void SetDpadDownButton(bool value)
Change the value of the D-pad down button on the controller.
void SetNorthFaceButton(bool value)
Change the value of the North Face button on the controller.
void SetRightX(double value)
Change the right X value of the controller's joystick.
void SetGuideButton(bool value)
Change the value of the Guide button on the controller.
void SetMisc4Button(bool value)
Change the value of the Miscellaneous 4 button on the controller.
void SetLeftPaddle1Button(bool value)
Change the value of the Left Paddle 1 button on the controller.
void SetRightTriggerAxis(double value)
Change the value of the right trigger axis on the controller.
void SetLeftX(double value)
Change the left X value of the controller's joystick.
void SetStartButton(bool value)
Change the value of the Start button on the controller.
GenericHIDSim(const GenericHID &joystick)
Constructs from a GenericHID object.
Definition CTREPCMSim.hpp:13
Definition CvSource.hpp:15