Skip to content

Commit

Permalink
Always tell Android we handled the BUTTON_MODE key
Browse files Browse the repository at this point in the history
Otherwise, as seen in #17245, some devies can decide to do something weird with it,
like exiting the app.
  • Loading branch information
hrydgard committed Apr 6, 2023
1 parent f390c3a commit d5f131f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions UI/NativeApp.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit d5f131f

Please sign in to comment.