mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-04 18:25:27 +02:00
Introduce DEVICE_ID_ANY, update operator == for KeyDef to match
This commit is contained in:
1 parent
a57a838c93
commit
5f2f9160f8
2 files changed
+3
-1
No files matched your search
@@ -4,6 +4,7 @@
|
||||
|
||||
const char *GetDeviceName(int deviceId) {
|
||||
switch (deviceId) {
|
||||
case DEVICE_ID_ANY: return "any";
|
||||
case DEVICE_ID_DEFAULT: return "built-in";
|
||||
case DEVICE_ID_KEYBOARD: return "kbd";
|
||||
case DEVICE_ID_PAD_0: return "pad1";
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@
|
||||
// Default device IDs
|
||||
|
||||
enum {
|
||||
DEVICE_ID_ANY = -1, // Represents any device ID
|
||||
DEVICE_ID_DEFAULT = 0, // Old Android
|
||||
DEVICE_ID_KEYBOARD = 1, // PC keyboard, android keyboards
|
||||
DEVICE_ID_MOUSE = 2, // PC mouse only (not touchscreen!)
|
||||
@@ -94,7 +95,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
bool operator == (const KeyDef &other) const {
|
||||
if (deviceId != other.deviceId) return false;
|
||||
if (deviceId != other.deviceId && deviceId != DEVICE_ID_ANY && other.deviceId != DEVICE_ID_ANY) return false;
|
||||
if (keyCode != other.keyCode) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user