From 8405fb060b54a1492a8fbc69ec5e5bcf1a90fe52 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Tue, 22 Nov 2011 00:41:15 +0000 Subject: [PATCH] - revert InputManager changes git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8763 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/core/com/jme3/input/InputManager.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/engine/src/core/com/jme3/input/InputManager.java b/engine/src/core/com/jme3/input/InputManager.java index baa3f1b5b..6c9a9370d 100644 --- a/engine/src/core/com/jme3/input/InputManager.java +++ b/engine/src/core/com/jme3/input/InputManager.java @@ -262,8 +262,8 @@ public class InputManager implements RawInputListener { } } - private void invokeAnalogsAndActions(int hash, float value, boolean applyTpf, float deadZone) { - if (value < deadZone) { + private void invokeAnalogsAndActions(int hash, float value, boolean applyTpf) { + if (value < axisDeadZone) { invokeAnalogs(hash, value, !applyTpf); return; } @@ -276,10 +276,6 @@ public class InputManager implements RawInputListener { boolean valueChanged = !axisValues.containsKey(hash); if (applyTpf) { value *= frameTPF; - }else{ - if (value != 0){ - axisValues.put(hash, value); - } } int size = maps.size(); @@ -342,13 +338,13 @@ public class InputManager implements RawInputListener { } else if (value < 0) { int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, true); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); - invokeAnalogsAndActions(hash, -value, true, axisDeadZone); + invokeAnalogsAndActions(hash, -value, true); axisValues.put(hash, -value); axisValues.remove(otherHash); } else { int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, true); - invokeAnalogsAndActions(hash, value, true, axisDeadZone); + invokeAnalogsAndActions(hash, value, true); axisValues.put(hash, value); axisValues.remove(otherHash); } @@ -391,18 +387,17 @@ public class InputManager implements RawInputListener { // rawListeners.get(i).onMouseMotionEvent(evt); // } - // Do not use dead zone for mouse motion events if (evt.getDX() != 0) { float val = Math.abs(evt.getDX()) / 1024f; - invokeAnalogsAndActions(MouseAxisTrigger.mouseAxisHash(MouseInput.AXIS_X, evt.getDX() < 0), val, false, 0); + invokeAnalogsAndActions(MouseAxisTrigger.mouseAxisHash(MouseInput.AXIS_X, evt.getDX() < 0), val, false); } if (evt.getDY() != 0) { float val = Math.abs(evt.getDY()) / 1024f; - invokeAnalogsAndActions(MouseAxisTrigger.mouseAxisHash(MouseInput.AXIS_Y, evt.getDY() < 0), val, false, 0); + invokeAnalogsAndActions(MouseAxisTrigger.mouseAxisHash(MouseInput.AXIS_Y, evt.getDY() < 0), val, false); } if (evt.getDeltaWheel() != 0) { float val = Math.abs(evt.getDeltaWheel()) / 100f; - invokeAnalogsAndActions(MouseAxisTrigger.mouseAxisHash(MouseInput.AXIS_WHEEL, evt.getDeltaWheel() < 0), val, false, 0); + invokeAnalogsAndActions(MouseAxisTrigger.mouseAxisHash(MouseInput.AXIS_WHEEL, evt.getDeltaWheel() < 0), val, false); } }