mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -04:00
Fix back key not being intercepted
This commit is contained in:
parent
2a12db6216
commit
165cc2a8f0
@ -350,10 +350,12 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
// Prevent back
|
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && !touchCharInput.isEnabled()) {
|
||||||
// Catch back as Esc keycode at another place
|
sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_ESCAPE);
|
||||||
sendKeyPress(LWJGLGLFWKeycode.GLFW_KEY_ESCAPE);
|
return true;
|
||||||
|
}
|
||||||
|
return super.dispatchKeyEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void switchKeyboardState() {
|
public static void switchKeyboardState() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user