소스 검색

Fix Android keyboard crash with left cursor

Fixes #32168.
Previously we were returning all key up and key down messages as unhandled to the OS. This was resulting in crashes on certain keypresses (left cursor), for undetermined reason.

This PR defaults all key up and keydown messages to be returned as handled by Godot, except those explicitly coded as exceptions (currently volume keys only).
lawnjelly 6 년 전
부모
커밋
ad5d0cca4d
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java

+ 2 - 4
platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java

@@ -96,7 +96,6 @@ public class GodotInputHandler implements InputDeviceListener {
 						GodotLib.joybutton(device_id, button, false);
 						GodotLib.joybutton(device_id, button, false);
 					}
 					}
 				});
 				});
-				return true;
 			}
 			}
 		} else {
 		} else {
 			final int chr = event.getUnicodeChar(0);
 			final int chr = event.getUnicodeChar(0);
@@ -108,7 +107,7 @@ public class GodotInputHandler implements InputDeviceListener {
 			});
 			});
 		};
 		};
 
 
-		return false;
+		return true;
 	}
 	}
 
 
 	public boolean onKeyDown(final int keyCode, KeyEvent event) {
 	public boolean onKeyDown(final int keyCode, KeyEvent event) {
@@ -142,7 +141,6 @@ public class GodotInputHandler implements InputDeviceListener {
 						GodotLib.joybutton(device_id, button, true);
 						GodotLib.joybutton(device_id, button, true);
 					}
 					}
 				});
 				});
-				return true;
 			}
 			}
 		} else {
 		} else {
 			final int chr = event.getUnicodeChar(0);
 			final int chr = event.getUnicodeChar(0);
@@ -154,7 +152,7 @@ public class GodotInputHandler implements InputDeviceListener {
 			});
 			});
 		};
 		};
 
 
-		return false;
+		return true;
 	}
 	}
 
 
 	public boolean onGenericMotionEvent(MotionEvent event) {
 	public boolean onGenericMotionEvent(MotionEvent event) {