2019-11-06 22:20:58 +00:00
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
2020-04-22 00:54:49 +00:00
|
|
|
|
|
|
|
#define MAX_JOYSTICKS 2
|
|
|
|
#define MAX_TRIGGERS 2
|
|
|
|
#define MAX_CONTROLLER_BUTTONS 32
|
|
|
|
|
2020-03-03 09:58:12 +00:00
|
|
|
enum ControllerButton : uint8_t
|
2019-11-06 22:20:58 +00:00
|
|
|
{
|
2020-04-22 00:54:49 +00:00
|
|
|
DEFAULT = 0,
|
|
|
|
NONE,
|
2019-11-06 22:20:58 +00:00
|
|
|
FACE_UP,
|
|
|
|
FACE_RIGHT,
|
|
|
|
FACE_DOWN,
|
|
|
|
FACE_LEFT,
|
|
|
|
LSTICK_CLICK,
|
|
|
|
RSTICK_CLICK,
|
|
|
|
LEFT_BUMPER,
|
|
|
|
RIGHT_BUMPER,
|
|
|
|
LEFT_TRIGGER,
|
|
|
|
RIGHT_TRIGGER,
|
|
|
|
BACK,
|
|
|
|
START,
|
|
|
|
DPAD_UP,
|
|
|
|
DPAD_RIGHT,
|
|
|
|
DPAD_DOWN,
|
|
|
|
DPAD_LEFT,
|
2020-04-22 00:54:49 +00:00
|
|
|
CAPTURE,
|
|
|
|
HOME,
|
2019-11-06 22:20:58 +00:00
|
|
|
SYNC,
|
2019-11-15 11:03:06 +00:00
|
|
|
TOUCHPAD,
|
2019-11-07 17:46:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NormalizedStick
|
|
|
|
{
|
|
|
|
float axis_x;
|
|
|
|
float axis_y;
|
2019-11-06 22:20:58 +00:00
|
|
|
};
|
|
|
|
|
2019-11-13 20:49:15 +00:00
|
|
|
union RGBAColor {
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint8_t r;
|
|
|
|
uint8_t g;
|
|
|
|
uint8_t b;
|
|
|
|
uint8_t a;
|
|
|
|
};
|
|
|
|
uint8_t values[4];
|
|
|
|
uint32_t rgbaValue;
|
|
|
|
};
|
|
|
|
|
2019-11-06 22:20:58 +00:00
|
|
|
struct ControllerConfig
|
|
|
|
{
|
2020-04-22 00:54:49 +00:00
|
|
|
uint8_t stickDeadzonePercent[MAX_JOYSTICKS]{};
|
|
|
|
uint16_t stickRotationDegrees[MAX_JOYSTICKS]{};
|
|
|
|
uint8_t triggerDeadzonePercent[MAX_TRIGGERS]{};
|
|
|
|
ControllerButton buttons[MAX_CONTROLLER_BUTTONS]{};
|
|
|
|
float triggers[MAX_TRIGGERS]{};
|
|
|
|
NormalizedStick sticks[MAX_JOYSTICKS]{};
|
2019-11-13 20:49:15 +00:00
|
|
|
bool swapDPADandLSTICK{false};
|
|
|
|
RGBAColor bodyColor{107, 107, 107, 255};
|
|
|
|
RGBAColor buttonsColor{0, 0, 0, 255};
|
|
|
|
RGBAColor leftGripColor{70, 70, 70, 255};
|
|
|
|
RGBAColor rightGripColor{70, 70, 70, 255};
|
2019-11-06 22:20:58 +00:00
|
|
|
};
|