From 92e85f9012aecfc4a9d8407fccd112b7b7dad725 Mon Sep 17 00:00:00 2001 From: NemesisMate Date: Thu, 21 Sep 2017 21:28:36 +0200 Subject: [PATCH] Fixed softkeyboard's (simulated) backspace not being recognized (#713) --- .../java/com/jme3/input/android/AndroidInputHandler14.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jme3-android/src/main/java/com/jme3/input/android/AndroidInputHandler14.java b/jme3-android/src/main/java/com/jme3/input/android/AndroidInputHandler14.java index 4b39ed24c..59df7c26c 100644 --- a/jme3-android/src/main/java/com/jme3/input/android/AndroidInputHandler14.java +++ b/jme3-android/src/main/java/com/jme3/input/android/AndroidInputHandler14.java @@ -139,8 +139,10 @@ public class AndroidInputHandler14 extends AndroidInputHandler implements View.O boolean isJoystick = ((source & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) || ((source & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK); + boolean isUnknown = + (source & android.view.InputDevice.SOURCE_UNKNOWN) == android.view.InputDevice.SOURCE_UNKNOWN; - if (isTouch && touchInput != null) { + if (touchInput != null && (isTouch || (isUnknown && this.touchInput.isSimulateKeyboard()))) { // logger.log(Level.INFO, "onKey source: {0}, isTouch: {1}", // new Object[]{source, isTouch}); consumed = touchInput.onKey(event);