Better filtering of inputs for the back button

This commit is contained in:
SerpentSpirale 2021-11-22 18:29:50 +01:00 committed by Boulay Mathias
parent 32a4141d32
commit 4a3a046e95

View file

@ -308,6 +308,7 @@ public class BaseMainActivity extends BaseActivity {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && !touchCharInput.isEnabled()) {
if(event.getAction() != KeyEvent.ACTION_UP) return true; // We eat it anyway
sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_ESCAPE);
return true;
}