Input event and device enums (#17514)

* Switch deviceID from int to enum InputDeviceID, globally

* Switch axisId to enum InputAxis

* Change int keycodes to InputKeyCode where it makes sense.

* SDL input buildfix

* SDL keycode buildfix

* Switch on enum warning fixes

* Qt keycode buildfix

* iOS keycode buildfix

* UWP keycode buildfix

* More iOS buildfix

* More iOS buildfix

* Update DinputDevice.cpp
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2023-05-26 18:40:13 +02:00
1 parent 6f380a7a0a
commit 2675d6ea43
32 files changed
+129 -133

No files matched your search

+3 -3
View File
@@ -126,7 +126,7 @@ static void UnloadXInputDLL() {}
// Permanent map. Actual mapping happens elsewhere.
static const struct {int from, to;} xinput_ctrl_map[] = {
static const struct { int from; InputKeyCode to; } xinput_ctrl_map[] = {
{XINPUT_GAMEPAD_A, NKCODE_BUTTON_A},
{XINPUT_GAMEPAD_B, NKCODE_BUTTON_B},
{XINPUT_GAMEPAD_X, NKCODE_BUTTON_X},
@@ -220,8 +220,8 @@ void XinputDevice::UpdatePad(int pad, const XINPUT_STATE &state, XINPUT_VIBRATIO
ApplyVibration(pad, vibration);
AxisInput axis;
axis.deviceId = DEVICE_ID_XINPUT_0 + pad;
auto sendAxis = [&](AndroidJoystickAxis axisId, float value) {
axis.deviceId = (InputDeviceID)(DEVICE_ID_XINPUT_0 + pad);
auto sendAxis = [&](InputAxis axisId, float value) {
axis.axisId = axisId;
axis.value = value;
NativeAxis(axis);