From d80de0cc5b74f5c8e8a4f77c80a361708d3bf7fa Mon Sep 17 00:00:00 2001 From: iwgeric Date: Sat, 18 Apr 2015 14:48:30 -0400 Subject: [PATCH] Android: Add static property to disable sensors but still have joysticks. May move this to AppSettings later, but not sure yet. --- .../main/java/com/jme3/input/android/AndroidJoyInput.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jme3-android/src/main/java/com/jme3/input/android/AndroidJoyInput.java b/jme3-android/src/main/java/com/jme3/input/android/AndroidJoyInput.java index e31504520..1e610d24e 100644 --- a/jme3-android/src/main/java/com/jme3/input/android/AndroidJoyInput.java +++ b/jme3-android/src/main/java/com/jme3/input/android/AndroidJoyInput.java @@ -79,6 +79,7 @@ import java.util.logging.Logger; */ public class AndroidJoyInput implements JoyInput { private static final Logger logger = Logger.getLogger(AndroidJoyInput.class.getName()); + public static boolean disableSensors = false; protected AndroidInputHandler inputHandler; protected List joystickList = new ArrayList(); @@ -208,7 +209,9 @@ public class AndroidJoyInput implements JoyInput { @Override public Joystick[] loadJoysticks(InputManager inputManager) { logger.log(Level.INFO, "loading joysticks for {0}", this.getClass().getName()); - joystickList.add(sensorJoyInput.loadJoystick(joystickList.size(), inputManager)); + if (!disableSensors) { + joystickList.add(sensorJoyInput.loadJoystick(joystickList.size(), inputManager)); + } return joystickList.toArray( new Joystick[joystickList.size()] ); }