mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-19 00:19:26 +00:00
Introduce DEVICE_ID_ANY, update operator == for KeyDef to match
This commit is contained in:
parent
a57a838c93
commit
5f2f9160f8
@ -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";
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user