mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-05 23:46:17 +00:00
Handle "--trigger-as-button" option from xboxdrv
This commit is contained in:
committed by
Iwan Timmer
parent
d61532799a
commit
161175b866
@@ -135,11 +135,17 @@ public class EvdevHandler implements Runnable {
|
||||
conn.sendMouseButtonDown(mouseButton);
|
||||
else if (value==EvdevConstants.KEY_RELEASED)
|
||||
conn.sendMouseButtonUp(mouseButton);
|
||||
} else if (gamepadButton>0) {
|
||||
if (value==EvdevConstants.KEY_PRESSED) {
|
||||
buttonFlags |= gamepadButton;
|
||||
} else if (value==EvdevConstants.KEY_RELEASED){
|
||||
buttonFlags &= ~gamepadButton;
|
||||
} else {
|
||||
if (gamepadButton != 0) {
|
||||
if (value==EvdevConstants.KEY_PRESSED) {
|
||||
buttonFlags |= gamepadButton;
|
||||
} else if (value==EvdevConstants.KEY_RELEASED){
|
||||
buttonFlags &= ~gamepadButton;
|
||||
}
|
||||
} else if (code==mapping.btn_throttle) {
|
||||
leftTrigger = (byte) (value==EvdevConstants.KEY_PRESSED ? -1 : 0);
|
||||
} else if (code==mapping.btn_rudder) {
|
||||
rightTrigger = (byte) (value==EvdevConstants.KEY_PRESSED ? -1 : 0);
|
||||
}
|
||||
conn.sendControllerInput(buttonFlags, leftTrigger, rightTrigger, leftStickX, leftStickY, rightStickX, rightStickY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user