mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-19 14:50:58 +00:00
reimplemented the trigger checkbox
This commit is contained in:
@@ -85,13 +85,16 @@ public class Gamepad implements DeviceListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private float sanitizeValue(Mapping mapped, float value) {
|
private float sanitizeValue(Mapping mapped, float value) {
|
||||||
|
float retVal = value;
|
||||||
if (mapped.invert) {
|
if (mapped.invert) {
|
||||||
return -value;
|
retVal = -retVal;
|
||||||
} else {
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
if (mapped.trigger) {
|
||||||
|
retVal = (retVal + 1) / 2;
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleAnalogComponent(GamepadComponent padComp, float value) {
|
private void handleAnalogComponent(GamepadComponent padComp, float value) {
|
||||||
switch (padComp) {
|
switch (padComp) {
|
||||||
case LS_X:
|
case LS_X:
|
||||||
|
|||||||
Reference in New Issue
Block a user