1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-10 16:19:59 +00:00

improvements to key config menu

- hide actionset selection if only 1 set is present
- show keys pressed
- highlight "tabs" a bit more visually
- rumble selected controller on device select change
This commit is contained in:
fgenesis 2020-07-07 16:24:03 +02:00
parent 04bf58ab91
commit 53b027067a
4 changed files with 76 additions and 23 deletions

View file

@ -13,6 +13,7 @@
#define MAX_JOYSTICK_BTN 32
#define MAX_JOYSTICK_AXIS 32
#define MAX_JOYSTICK_HATS 8
const static float JOY_AXIS_THRESHOLD = 0.6f;
@ -38,14 +39,16 @@ public:
bool anyButton() const;
bool getButton(size_t id) const { return !!(buttonBitmask & (1u << id)); }
float getAxisUncalibrated(int id) const;
int getNumAxes() const;
unsigned getNumAxes() const;
unsigned getNumButtons() const;
unsigned getNumHats() const;
int getIndex() const { return stickIndex; }
int getInstanceID() const { return instanceID; }
inline bool isEnabled() const { return enabled; }
inline void setEnabled(bool on) { enabled = on; }
const char *getAxisName(int axis) const;
const char *getButtonName(int btn) const;
const char *getAxisName(unsigned axis) const;
const char *getButtonName(unsigned btn) const;
const char *getName() const;
const char *getGUID() const;
@ -59,7 +62,7 @@ private:
int stickIndex;
int instanceID;
unsigned buttonBitmask;
int numJoyAxes;
unsigned numJoyAxes, numHats, numButtons;
SDL_Joystick *sdl_joy;
float axisRaw[MAX_JOYSTICK_AXIS];
std::string name;