From d5f131f6a762dde748f5661ab1fc0c026c6b3e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 6 Apr 2023 12:24:31 +0200 Subject: [PATCH] Always tell Android we handled the BUTTON_MODE key Otherwise, as seen in #17245, some devies can decide to do something weird with it, like exiting the app. --- UI/NativeApp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index cb2a4ca675..1459019eab 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1275,6 +1275,13 @@ bool NativeKey(const KeyInput &key) { HLEPlugins::PluginDataKeys[key.keyCode] = (key.flags & KEY_DOWN) ? 1 : 0; retval = g_screenManager->key(key); } + + // The Mode key can have weird consequences on some devices, see #17245. + if (key.keyCode == NKCODE_BUTTON_MODE) { + // Tell the caller that we handled the key. + retval = true; + } + return retval; }