-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameControllerStatePreview.cs
544 lines (446 loc) · 20.7 KB
/
GameControllerStatePreview.cs
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
using LibUsbDotNet;
using LibUsbDotNet.Main;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace BeeDevelopment.XboxControllerAnalyser {
public partial class GameControllerStatePreview : Form {
public UsbDevice? Device { get; set; }
public bool ShowUnusedFields { get; set; }
private int numericDataBase = 10;
public int NumericDataBase {
get { return this.numericDataBase; }
set {
switch (value) {
case 10:
this.numericDataBase = value;
this.decimalRadioButton.Checked = true;
this.leftActuatorSpinner.Hexadecimal = false;
this.rightActuatorSpinner.Hexadecimal = false;
break;
case 16:
this.numericDataBase = value;
this.hexadecimalRadioButton.Checked = true;
this.leftActuatorSpinner.Hexadecimal = true;
this.rightActuatorSpinner.Hexadecimal = true;
break;
default:
throw new InvalidOperationException();
}
}
}
private void NumericDataBaseRadioButton_CheckedChanged(object sender, EventArgs e) {
if (this.decimalRadioButton.Checked) {
this.NumericDataBase = 10;
} else if (this.hexadecimalRadioButton.Checked) {
this.NumericDataBase = 16;
}
}
private string ByteFormatString {
get {
switch (this.NumericDataBase) {
case 16:
return "0x{0:X2}";
default:
return "{0}";
}
}
}
private string UShortFormatString {
get {
switch (this.NumericDataBase) {
case 16:
return "0x{0:X4}";
default:
return "{0}";
}
}
}
private string ShortCoordinatesFormatString {
get {
switch (this.NumericDataBase) {
case 16:
return "(0x{0:X4},0x{1:X4})";
default:
return "({0,6:0},{1,6:0})";
}
}
}
[AllowNull] ListViewItem.ListViewSubItem dpad;
[AllowNull] ListViewItem.ListViewSubItem start;
[AllowNull] ListViewItem.ListViewSubItem back;
[AllowNull] ListViewItem.ListViewSubItem leftStickButton;
[AllowNull] ListViewItem.ListViewSubItem rightStickButton;
[AllowNull] ListViewItem.ListViewSubItem lightGunLightVisible;
[AllowNull] ListViewItem.ListViewSubItem lightGunUnknown1;
[AllowNull] ListViewItem.ListViewSubItem lightGunUnknown2;
[AllowNull] ListViewItem.ListViewSubItem a;
[AllowNull] ListViewItem.ListViewSubItem b;
[AllowNull] ListViewItem.ListViewSubItem x;
[AllowNull] ListViewItem.ListViewSubItem y;
[AllowNull] ListViewItem.ListViewSubItem black;
[AllowNull] ListViewItem.ListViewSubItem white;
[AllowNull] ListViewItem.ListViewSubItem leftTrigger;
[AllowNull] ListViewItem.ListViewSubItem rightTrigger;
[AllowNull] ListViewItem.ListViewSubItem leftStick;
[AllowNull] ListViewItem.ListViewSubItem rightStick;
private ListViewItem.ListViewSubItem CreateLivePreviewListViewItem(string field) {
Font monospaceFont = this.Font;
MainInterface? mainInterface = this.Owner as MainInterface;
if (mainInterface != null) {
monospaceFont = mainInterface.MonospaceFont;
}
var group = this.livePreviewFields.Groups[^1];
var fieldItem = new ListViewItem {
Text = field,
Group = group,
UseItemStyleForSubItems = false,
};
var subItem = new ListViewItem.ListViewSubItem {
Tag = fieldItem,
Font = monospaceFont,
};
fieldItem.SubItems.Add(subItem);
this.livePreviewFields.Items.Add(fieldItem);
return subItem;
}
private void AddAllPreviewFields() {
this.livePreviewFields.Items.Clear();
this.livePreviewFields.Groups.Clear();
this.livePreviewFields.Groups.Add(new ListViewGroup("Digital Buttons"));
this.dpad = this.CreateLivePreviewListViewItem("Direction Pad");
this.start = this.CreateLivePreviewListViewItem("Start");
this.back = this.CreateLivePreviewListViewItem("Back");
this.leftStickButton = this.CreateLivePreviewListViewItem("Left Stick");
this.rightStickButton = this.CreateLivePreviewListViewItem("Right Stick");
this.livePreviewFields.Groups.Add(new ListViewGroup("Light Gun Flags"));
this.lightGunLightVisible = this.CreateLivePreviewListViewItem("Light Visible");
this.lightGunUnknown1 = this.CreateLivePreviewListViewItem("Unknown 1");
this.lightGunUnknown2 = this.CreateLivePreviewListViewItem("Unknown 2");
this.livePreviewFields.Groups.Add(new ListViewGroup("Analogue Buttons"));
this.a = this.CreateLivePreviewListViewItem("A");
this.b = this.CreateLivePreviewListViewItem("B");
this.x = this.CreateLivePreviewListViewItem("X");
this.y = this.CreateLivePreviewListViewItem("Y");
this.black = this.CreateLivePreviewListViewItem("Black");
this.white = this.CreateLivePreviewListViewItem("White");
this.livePreviewFields.Groups.Add(new ListViewGroup("Triggers"));
this.leftTrigger = this.CreateLivePreviewListViewItem("Left Trigger");
this.rightTrigger = this.CreateLivePreviewListViewItem("Right Trigger");
this.livePreviewFields.Groups.Add(new ListViewGroup("Analogue Sticks"));
this.leftStick = this.CreateLivePreviewListViewItem("Left Stick");
this.rightStick = this.CreateLivePreviewListViewItem("Right Stick");
this.leftActuatorStrength.Enabled = this.leftActuatorLabel.Enabled = true;
this.rightActuatorStrength.Enabled = this.rightActuatorLabel.Enabled = true;
}
private void RemoveUnusedPreviewFields() {
// get capabilities to hide unused fields
if (this.Device != null) {
// descriptor
{
var setupPacket = new UsbSetupPacket {
RequestType = 0xC1,
Request = 6,
Value = 0x4200,
Index = 0,
Length = 16,
};
var response = new byte[setupPacket.Length];
var handle = GCHandle.Alloc(response, GCHandleType.Pinned);
bool success = false;
try {
success = this.Device.ControlTransfer(ref setupPacket, handle.AddrOfPinnedObject(), setupPacket.Length, out int length) && length == response.Length;
} finally {
handle.Free();
}
if (success && response[4] == 0x01 && response[5] == 0x50) {
this.lightGunCalibrationChanged = true;
} else {
this.lightGunCalibrationGroup.Enabled = false;
this.lightGunCalibrationGroup.Visible = false;
this.controlTable.RowStyles[1].Height = 0;
}
}
// input
{
var setupPacket = new UsbSetupPacket {
RequestType = 0xC1,
Request = 1,
Value = 0x0100,
Index = 0,
Length = 20,
};
var response = new byte[setupPacket.Length];
var handle = GCHandle.Alloc(response, GCHandleType.Pinned);
bool success = false;
try {
success = this.Device.ControlTransfer(ref setupPacket, handle.AddrOfPinnedObject(), setupPacket.Length, out int length) && length == response.Length;
} finally {
handle.Free();
}
if (success) {
var state = new XboxInputDevice.GameControllerInputState(response);
if ((state.DigitalButtons & (XboxInputDevice.GameControllerDigitalButtons.Up | XboxInputDevice.GameControllerDigitalButtons.Down | XboxInputDevice.GameControllerDigitalButtons.Left | XboxInputDevice.GameControllerDigitalButtons.Right)) == XboxInputDevice.GameControllerDigitalButtons.None) this.livePreviewFields.Items.Remove(this.dpad.Tag as ListViewItem);
if ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.Start) == XboxInputDevice.GameControllerDigitalButtons.None) this.livePreviewFields.Items.Remove(this.start.Tag as ListViewItem);
if ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.Back) == XboxInputDevice.GameControllerDigitalButtons.None) this.livePreviewFields.Items.Remove(this.back.Tag as ListViewItem);
if ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.LeftStick) == XboxInputDevice.GameControllerDigitalButtons.None) this.livePreviewFields.Items.Remove(this.leftStickButton.Tag as ListViewItem);
if ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.RightStick) == XboxInputDevice.GameControllerDigitalButtons.None) this.livePreviewFields.Items.Remove(this.rightStickButton.Tag as ListViewItem);
if ((state.LightGunFlags & XboxInputDevice.GameControllerLightGunFlags.LightVisible) == XboxInputDevice.GameControllerLightGunFlags.None) this.livePreviewFields.Items.Remove(this.lightGunLightVisible.Tag as ListViewItem);
if ((state.LightGunFlags & XboxInputDevice.GameControllerLightGunFlags.Unknown1) == XboxInputDevice.GameControllerLightGunFlags.None) this.livePreviewFields.Items.Remove(this.lightGunUnknown1.Tag as ListViewItem);
if ((state.LightGunFlags & XboxInputDevice.GameControllerLightGunFlags.Unknown2) == XboxInputDevice.GameControllerLightGunFlags.None) this.livePreviewFields.Items.Remove(this.lightGunUnknown2.Tag as ListViewItem);
if (state.A == 0) this.livePreviewFields.Items.Remove(this.a.Tag as ListViewItem);
if (state.B == 0) this.livePreviewFields.Items.Remove(this.b.Tag as ListViewItem);
if (state.X == 0) this.livePreviewFields.Items.Remove(this.x.Tag as ListViewItem);
if (state.Y == 0) this.livePreviewFields.Items.Remove(this.y.Tag as ListViewItem);
if (state.Black == 0) this.livePreviewFields.Items.Remove(this.black.Tag as ListViewItem);
if (state.White == 0) this.livePreviewFields.Items.Remove(this.white.Tag as ListViewItem);
if (state.LeftTrigger == 0) this.livePreviewFields.Items.Remove(this.leftTrigger.Tag as ListViewItem);
if (state.RightTrigger == 0) this.livePreviewFields.Items.Remove(this.rightTrigger.Tag as ListViewItem);
if (state.LeftStickX == 0 && state.LeftStickY == 0) this.livePreviewFields.Items.Remove(this.leftStick.Tag as ListViewItem);
if (state.RightStickX == 0 && state.RightStickY == 0) this.livePreviewFields.Items.Remove(this.rightStick.Tag as ListViewItem);
}
}
// output
{
var setupPacket = new UsbSetupPacket {
RequestType = 0xC1,
Request = 1,
Value = 0x0200,
Index = 0,
Length = 6,
};
var response = new byte[setupPacket.Length];
var handle = GCHandle.Alloc(response, GCHandleType.Pinned);
bool success = false;
try {
success = this.Device.ControlTransfer(ref setupPacket, handle.AddrOfPinnedObject(), setupPacket.Length, out int length) && length == response.Length;
} finally {
handle.Free();
}
if (success) {
var state = new XboxInputDevice.GameControllerOutputState(response);
this.leftActuatorStrength.Enabled = this.leftActuatorLabel.Enabled = state.LeftActuatorStrength != 0;
this.rightActuatorStrength.Enabled = this.rightActuatorLabel.Enabled = state.RightActuatorStrength != 0;
} else {
this.leftActuatorStrength.Enabled = this.leftActuatorLabel.Enabled = false;
this.rightActuatorStrength.Enabled = this.rightActuatorLabel.Enabled = false;
}
}
}
}
public GameControllerStatePreview() {
InitializeComponent();
}
private void GameControllerStatePreview_Load(object sender, EventArgs e) {
this.NumericDataBase = this.NumericDataBase;
this.AddAllPreviewFields();
// double-buffer list view
var prop = typeof(ListView).GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
prop?.SetValue(this.livePreviewFields, true, null);
if (this.ShowUnusedFields) {
this.fieldVisibilityAll.Checked = true;
} else {
this.RemoveUnusedPreviewFields();
}
// poll the controller for its state
if (this.Device != null && this.Device.IsOpen) {
this.updateTimer.Start();
}
}
private void GameControllerStatePreview_FormClosing(object sender, FormClosingEventArgs e) {
this.updateTimer.Stop();
if (this.Device != null) {
// try to switch off the motors
if (this.leftActuatorStrength.Enabled || this.rightActuatorStrength.Enabled) {
var report = new XboxInputDevice.GameControllerOutputState {
LeftActuatorStrength = 0,
RightActuatorStrength = 0
};
var data = report.GetBytes();
var setupPacket = new UsbSetupPacket {
RequestType = 0x21,
Request = 9,
Value = 0x0200,
Index = 0,
Length = (short)data.Length,
};
var handle = GCHandle.Alloc(data, GCHandleType.Pinned);
try {
for (int i = 0; i < 10; ++i) {
if (this.Device.ControlTransfer(ref setupPacket, handle.AddrOfPinnedObject(), setupPacket.Length, out int length) && length == data.Length) {
break;
}
Thread.Sleep(100);
}
} finally {
handle.Free();
}
}
}
}
private void UpdateTimer_Tick(object sender, EventArgs e) {
if (this.Device != null) {
{
// Calibrate light gun
if (lightGunCalibrationChanged) {
var setupPacket = new UsbSetupPacket {
RequestType = 0x21,
Request = 9,
Value = 0x0201,
Index = 0,
Length = 10,
};
var report = new XboxInputDevice.GameControllerLightGunCalibrationState {
CentreXOffset = (short)this.lightGunCalibrationCentreX.Value,
CentreYOffset = (short)this.lightGunCalibrationCentreY.Value,
TopLeftXOffset = (short)this.lightGunCalibrationTopLeftX.Value,
TopLeftYOffset = (short)this.lightGunCalibrationTopLeftY.Value,
};
var data = report.GetBytes();
var handle = GCHandle.Alloc(data, GCHandleType.Pinned);
bool success = false;
try {
success = this.Device.ControlTransfer(ref setupPacket, handle.AddrOfPinnedObject(), setupPacket.Length, out int length) && length == data.Length;
} finally {
handle.Free();
}
if (success) {
lightGunCalibrationChanged = false;
} else {
this.lightGunCalibrationGroup.Enabled = false;
}
}
{
// GET_REPORT
var setupPacket = new UsbSetupPacket {
RequestType = 0xA1,
Request = 1,
Value = 0x0100,
Index = 0,
Length = 20,
};
var response = new byte[setupPacket.Length];
var handle = GCHandle.Alloc(response, GCHandleType.Pinned);
bool success = false;
try {
success = this.Device.ControlTransfer(ref setupPacket, handle.AddrOfPinnedObject(), setupPacket.Length, out int length) && length == response.Length;
} finally {
handle.Free();
}
if (this.inputGroup.Enabled = success) {
var state = new XboxInputDevice.GameControllerInputState(response);
this.dpad.Text = (state.DigitalButtons & (XboxInputDevice.GameControllerDigitalButtons.Up | XboxInputDevice.GameControllerDigitalButtons.Down | XboxInputDevice.GameControllerDigitalButtons.Left | XboxInputDevice.GameControllerDigitalButtons.Right)).ToString();
this.start.Text = ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.Start) != XboxInputDevice.GameControllerDigitalButtons.None).ToString();
this.back.Text = ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.Back) != XboxInputDevice.GameControllerDigitalButtons.None).ToString();
this.leftStickButton.Text = ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.LeftStick) != XboxInputDevice.GameControllerDigitalButtons.None).ToString();
this.rightStickButton.Text = ((state.DigitalButtons & XboxInputDevice.GameControllerDigitalButtons.RightStick) != XboxInputDevice.GameControllerDigitalButtons.None).ToString();
this.lightGunLightVisible.Text = ((state.LightGunFlags & XboxInputDevice.GameControllerLightGunFlags.LightVisible) != XboxInputDevice.GameControllerLightGunFlags.None).ToString();
this.lightGunUnknown1.Text = ((state.LightGunFlags & XboxInputDevice.GameControllerLightGunFlags.Unknown1) != XboxInputDevice.GameControllerLightGunFlags.None).ToString();
this.lightGunUnknown2.Text = ((state.LightGunFlags & XboxInputDevice.GameControllerLightGunFlags.Unknown2) != XboxInputDevice.GameControllerLightGunFlags.None).ToString();
this.a.Text = string.Format(ByteFormatString, state.A);
this.b.Text = string.Format(ByteFormatString, state.B);
this.x.Text = string.Format(ByteFormatString, state.X);
this.y.Text = string.Format(ByteFormatString, state.Y);
this.black.Text = string.Format(ByteFormatString, state.Black);
this.white.Text = string.Format(ByteFormatString, state.White);
this.leftTrigger.Text = string.Format(ByteFormatString, state.LeftTrigger);
this.rightTrigger.Text = string.Format(ByteFormatString, state.RightTrigger);
this.leftStick.Text = string.Format(ShortCoordinatesFormatString, state.LeftStickX, state.LeftStickY);
this.rightStick.Text = string.Format(ShortCoordinatesFormatString, state.RightStickX, state.RightStickY);
if (this.lightGunCalibrationGroup.Enabled && state.A > 127 && (state.LightGunFlags & XboxInputDevice.GameControllerLightGunFlags.LightVisible) != XboxInputDevice.GameControllerLightGunFlags.None) {
if (this.lightGunCalibrateCentreCheckbox.Checked) {
this.lightGunCalibrateCentreCheckbox.Checked = false;
this.lightGunCalibrationCentreX.Value = Math.Max(short.MinValue, Math.Min(short.MaxValue, -state.LeftStickX + this.lightGunCalibrationCentreX.Value));
this.lightGunCalibrationCentreY.Value = Math.Max(short.MinValue, Math.Min(short.MaxValue, -state.LeftStickY + this.lightGunCalibrationCentreY.Value));
this.lightGunCalibrationChanged = true;
}
if (this.lightGunCalibrateTopLeftCheckbox.Checked) {
this.lightGunCalibrateTopLeftCheckbox.Checked = false;
this.lightGunCalibrationTopLeftX.Value = Math.Max(short.MinValue, Math.Min(short.MaxValue, -25000 - state.LeftStickX));
this.lightGunCalibrationTopLeftY.Value = Math.Max(short.MinValue, Math.Min(short.MaxValue, +25000 - state.LeftStickY));
this.lightGunCalibrationChanged = true;
}
}
}
}
}
if (this.leftActuatorStrength.Enabled || this.rightActuatorStrength.Enabled) {
var report = new XboxInputDevice.GameControllerOutputState {
LeftActuatorStrength = (ushort)this.leftActuatorStrength.Value,
RightActuatorStrength = (ushort)this.rightActuatorStrength.Value
};
var data = report.GetBytes();
var setupPacket = new UsbSetupPacket {
RequestType = 0x21,
Request = 9,
Value = 0x0200,
Index = 0,
Length = (short)data.Length,
};
var handle = GCHandle.Alloc(data, GCHandleType.Pinned);
try {
this.forceFeedbackOutputGroup.Enabled = (this.Device.ControlTransfer(ref setupPacket, handle.AddrOfPinnedObject(), setupPacket.Length, out int length) && length == setupPacket.Length);
} finally {
handle.Free();
}
}
}
}
private void FieldVisibility_CheckedChanged(object sender, EventArgs e) {
var showUnusedFieldsChange = this.fieldVisibilityAll.Checked;
if (this.ShowUnusedFields != showUnusedFieldsChange) {
this.ShowUnusedFields = showUnusedFieldsChange;
this.AddAllPreviewFields();
if (!this.ShowUnusedFields) {
this.RemoveUnusedPreviewFields();
}
}
}
bool lightGunCalibrationChanged = true;
private void LightGunCalibrationTrackBar_Scroll(object sender, EventArgs e) {
lightGunCalibrationChanged = true;
}
private void CalibrateCheckbox_CheckedChanged(object sender, EventArgs e) {
var checkbox = sender as CheckBox;
if (checkbox == null) {
lightGunCalibrateCentreCheckbox.Checked = false;
lightGunCalibrateTopLeftCheckbox.Checked = false;
} else if (checkbox.Checked) {
if (checkbox == lightGunCalibrateCentreCheckbox) {
lightGunCalibrateTopLeftCheckbox.Checked = false;
this.lightGunCalibrationCentreX.Value = 0;
this.lightGunCalibrationCentreY.Value = 0;
this.lightGunCalibrationTopLeftX.Value = 0;
this.lightGunCalibrationTopLeftY.Value = 0;
this.lightGunCalibrationChanged = true;
} else if (checkbox == lightGunCalibrateTopLeftCheckbox) {
lightGunCalibrateCentreCheckbox.Checked = false;
this.lightGunCalibrationTopLeftX.Value = 0;
this.lightGunCalibrationTopLeftY.Value = 0;
this.lightGunCalibrationChanged = true;
}
}
}
private void LeftActuatorSpinner_ValueChanged(object sender, EventArgs e) {
if (this.leftActuatorStrength.Value != (int)this.leftActuatorSpinner.Value) {
this.leftActuatorStrength.Value = (int)this.leftActuatorSpinner.Value;
}
}
private void RightActuatorSpinner_ValueChanged(object sender, EventArgs e) {
if (this.rightActuatorStrength.Value != (int)this.rightActuatorSpinner.Value) {
this.rightActuatorStrength.Value = (int)this.rightActuatorSpinner.Value;
}
}
private void LeftActuatorStrength_ValueChanged(object sender, EventArgs e) {
if ((int)this.leftActuatorSpinner.Value != this.leftActuatorStrength.Value) {
this.leftActuatorSpinner.Value = this.leftActuatorStrength.Value;
}
}
private void RightActuatorStrength_ValueChanged(object sender, EventArgs e) {
if ((int)this.rightActuatorSpinner.Value != this.rightActuatorStrength.Value) {
this.rightActuatorSpinner.Value = this.rightActuatorStrength.Value;
}
}
}
}