Fix back button to right mouse button conversion

This commit is contained in:
artdeell 2022-11-18 09:42:15 +03:00
parent c0e4d45ff3
commit 2041834e6f

View File

@ -451,12 +451,15 @@ public class MainActivity extends BaseActivity {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if(isInEditor) return super.dispatchKeyEvent(event);
boolean handleEvent;
if(!(handleEvent = minecraftGLView.processKeyEvent(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;
}
return minecraftGLView.processKeyEvent(event);
}
return handleEvent;
}
public static void switchKeyboardState() {