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

+9 -3
View File
@@ -349,7 +349,7 @@ bool Clickable::Key(const KeyInput &key) {
down_ = false;
ret = true;
}
} else if (IsEscapeKey(key)) {
} else if (down_ && IsEscapeKey(key)) {
down_ = false;
}
}
@@ -1190,6 +1190,8 @@ bool TextEdit::Key(const KeyInput &input) {
case NKCODE_BACK:
case NKCODE_ESCAPE:
return false;
default:
break;
}
if (ctrlDown_) {
@@ -1227,6 +1229,8 @@ bool TextEdit::Key(const KeyInput &input) {
case NKCODE_Z:
text_ = undo_;
break;
default:
break;
}
}
@@ -1244,6 +1248,8 @@ bool TextEdit::Key(const KeyInput &input) {
case NKCODE_CTRL_RIGHT:
ctrlDown_ = false;
break;
default:
break;
}
}
@@ -1369,7 +1375,7 @@ bool Slider::Key(const KeyInput &input) {
}
}
bool Slider::ApplyKey(int keyCode) {
bool Slider::ApplyKey(InputKeyCode keyCode) {
switch (keyCode) {
case NKCODE_DPAD_LEFT:
case NKCODE_MINUS:
@@ -1497,7 +1503,7 @@ bool SliderFloat::Key(const KeyInput &input) {
}
}
bool SliderFloat::ApplyKey(int keyCode) {
bool SliderFloat::ApplyKey(InputKeyCode keyCode) {
switch (keyCode) {
case NKCODE_DPAD_LEFT:
case NKCODE_MINUS: