浏览代码

Android: Fix issue handling key events that are tied to both keyboard and gamepad

iwgeric 10 年之前
父节点
当前提交
6c24390663
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      jme3-android/src/main/java/com/jme3/input/android/AndroidInputHandler14.java

+ 2 - 1
jme3-android/src/main/java/com/jme3/input/android/AndroidInputHandler14.java

@@ -148,7 +148,8 @@ public class AndroidInputHandler14 extends AndroidInputHandler implements View.O
         if (isJoystick && joyInput != null) {
 //            logger.log(Level.INFO, "onKey source: {0}, isJoystick: {1}",
 //                    new Object[]{source, isJoystick});
-            consumed = consumed || ((AndroidJoyInput14)joyInput).onKey(event);
+            // use inclusive OR to make sure the onKey method is called.
+            consumed = consumed | ((AndroidJoyInput14)joyInput).onKey(event);
         }
 
         return consumed;