Android: Ignore back-button events from other devices than Default if the back button is mapped.

Update native.

Should help #7254.
This commit is contained in:
Henrik Rydgard committed 2015-01-02 16:43:08 +01:00
1 parent 13c4a22967
commit 87d221e069
2 files changed
+9 -5

No files matched your search

+8 -4
View File
@@ -408,10 +408,6 @@ inline void EmuScreen::setVKeyAnalogY(int stick, int virtualKeyMin, int virtualK
}
bool EmuScreen::key(const KeyInput &key) {
if ((key.flags & KEY_DOWN) && key.keyCode == NKCODE_BACK) {
pauseTrigger_ = true;
}
std::vector<int> pspKeys;
KeyMap::KeyToPspButton(key.deviceId, key.keyCode, &pspKeys);
@@ -423,6 +419,14 @@ bool EmuScreen::key(const KeyInput &key) {
for (size_t i = 0; i < pspKeys.size(); i++) {
pspKey(pspKeys[i], key.flags);
}
if (!pspKeys.size() || key.deviceId == DEVICE_ID_DEFAULT) {
if ((key.flags & KEY_DOWN) && key.keyCode == NKCODE_BACK) {
pauseTrigger_ = true;
return true;
}
}
return pspKeys.size() > 0;
}