Mitigate missing first key with hardware keyboard

This commit is contained in:
Boulay Mathias 2022-07-20 23:12:18 +02:00
parent a6a8296968
commit c47f14d3bf
2 changed files with 2 additions and 3 deletions

View File

@ -376,7 +376,7 @@ public class BaseMainActivity extends BaseActivity {
sendKeyPress(LwjglGlfwKeycode.GLFW_KEY_ESCAPE); sendKeyPress(LwjglGlfwKeycode.GLFW_KEY_ESCAPE);
return true; return true;
} }
return super.dispatchKeyEvent(event); return minecraftGLView.processKeyEvent(event);
} }
public static void switchKeyboardState() { public static void switchKeyboardState() {

View File

@ -480,8 +480,7 @@ public class MinecraftGLSurface extends View {
} }
/** The event for keyboard/ gamepad button inputs */ /** The event for keyboard/ gamepad button inputs */
@Override public boolean processKeyEvent(KeyEvent event) {
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
//Toast.makeText(this, event.toString(),Toast.LENGTH_SHORT).show(); //Toast.makeText(this, event.toString(),Toast.LENGTH_SHORT).show();
//Toast.makeText(this, event.getDevice().toString(), Toast.LENGTH_SHORT).show(); //Toast.makeText(this, event.getDevice().toString(), Toast.LENGTH_SHORT).show();