1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-12-27 06:15:19 +00:00
sys-con/ControllerUSB/include/ControllerConfig.h

44 lines
793 B
C
Raw Normal View History

2019-11-06 22:20:58 +00:00
#pragma once
#include <cstdint>
enum ControllerButton
{
NOT_SET = -1,
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,
SYNC,
GUIDE,
2019-11-07 17:46:47 +00:00
NUM_CONTROLLERBUTTONS,
};
struct NormalizedStick
{
float axis_x;
float axis_y;
2019-11-06 22:20:58 +00:00
};
struct ControllerConfig
{
2019-11-07 17:46:47 +00:00
uint8_t leftStickDeadzonePercent;
uint8_t rightStickDeadzonePercent;
uint16_t leftStickRotationDegrees;
uint16_t rightStickRotationDegrees;
uint8_t triggerDeadzonePercent;
ControllerButton buttons[NUM_CONTROLLERBUTTONS];
float triggers[2];
NormalizedStick sticks[2];
2019-11-09 20:36:52 +00:00
bool swapDPADandLSTICK;
2019-11-06 22:20:58 +00:00
};