mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-23 08:36:42 +00:00
Access the Type enum through SourceComponent. Check the absolute value of the new value so negative works too.
This commit is contained in:
@@ -30,7 +30,6 @@ import com.limelight.input.gamepad.GamepadListener;
|
|||||||
import com.limelight.input.gamepad.GamepadMapping;
|
import com.limelight.input.gamepad.GamepadMapping;
|
||||||
import com.limelight.input.gamepad.GamepadMapping.Mapping;
|
import com.limelight.input.gamepad.GamepadMapping.Mapping;
|
||||||
import com.limelight.input.gamepad.SourceComponent;
|
import com.limelight.input.gamepad.SourceComponent;
|
||||||
import com.limelight.input.gamepad.SourceComponent.Type;
|
|
||||||
import com.limelight.settings.GamepadSettingsManager;
|
import com.limelight.settings.GamepadSettingsManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -311,15 +310,15 @@ public class GamepadConfigFrame extends JFrame {
|
|||||||
@Override
|
@Override
|
||||||
public void handleButton(Device device, int buttonId, boolean pressed) {
|
public void handleButton(Device device, int buttonId, boolean pressed) {
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
newMapping = new SourceComponent(Type.BUTTON, buttonId);
|
newMapping = new SourceComponent(SourceComponent.Type.BUTTON, buttonId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleAxis(Device device, int axisId, float newValue,
|
public void handleAxis(Device device, int axisId, float newValue,
|
||||||
float lastValue) {
|
float lastValue) {
|
||||||
if (newValue > 0.75) {
|
if (Math.abs(newValue) > 0.75) {
|
||||||
newMapping = new SourceComponent(Type.AXIS, axisId);
|
newMapping = new SourceComponent(SourceComponent.Type.AXIS, axisId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user