mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-02-16 10:30:47 +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.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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user