Skip to content

Commit e099488

Browse files
committed
Re-ordered control enumeration to match joy.cpl
With this numbering it's possible to call "setButton(number)" as the button numbers match the numbers in the Windows joystick control panel.
1 parent 5825fcd commit e099488

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/XInput.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929

3030
#include <Arduino.h>
3131

32-
enum XInputControl {
33-
BUTTON_A,
34-
BUTTON_B,
35-
BUTTON_X,
36-
BUTTON_Y,
37-
BUTTON_LB,
38-
BUTTON_RB,
39-
BUTTON_BACK,
40-
BUTTON_START,
41-
BUTTON_L3,
42-
BUTTON_R3,
43-
BUTTON_LOGO,
32+
enum XInputControl : uint8_t {
33+
BUTTON_LOGO = 0,
34+
BUTTON_A = 1,
35+
BUTTON_B = 2,
36+
BUTTON_X = 3,
37+
BUTTON_Y = 4,
38+
BUTTON_LB = 5,
39+
BUTTON_RB = 6,
40+
BUTTON_BACK = 7,
41+
BUTTON_START = 8,
42+
BUTTON_L3 = 9,
43+
BUTTON_R3 = 10,
4444
DPAD_UP,
4545
DPAD_DOWN,
4646
DPAD_LEFT,

0 commit comments

Comments
 (0)