From 6952b1736ee68d916fdf466bc3f8c85bfd2ebc9c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 30 Dec 2013 23:29:33 -0600 Subject: [PATCH] Access the Type enum through SourceComponent. Check the absolute value of the new value so negative works too. --- src/com/limelight/gui/GamepadConfigFrame.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/limelight/gui/GamepadConfigFrame.java b/src/com/limelight/gui/GamepadConfigFrame.java index 40ddb7f..198d242 100644 --- a/src/com/limelight/gui/GamepadConfigFrame.java +++ b/src/com/limelight/gui/GamepadConfigFrame.java @@ -30,7 +30,6 @@ import com.limelight.input.gamepad.GamepadListener; import com.limelight.input.gamepad.GamepadMapping; import com.limelight.input.gamepad.GamepadMapping.Mapping; import com.limelight.input.gamepad.SourceComponent; -import com.limelight.input.gamepad.SourceComponent.Type; import com.limelight.settings.GamepadSettingsManager; /** @@ -311,15 +310,15 @@ public class GamepadConfigFrame extends JFrame { @Override public void handleButton(Device device, int buttonId, boolean pressed) { if (pressed) { - newMapping = new SourceComponent(Type.BUTTON, buttonId); + newMapping = new SourceComponent(SourceComponent.Type.BUTTON, buttonId); } } @Override public void handleAxis(Device device, int axisId, float newValue, float lastValue) { - if (newValue > 0.75) { - newMapping = new SourceComponent(Type.AXIS, axisId); + if (Math.abs(newValue) > 0.75) { + newMapping = new SourceComponent(SourceComponent.Type.AXIS, axisId); } }