mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-16 13:31:51 +00:00
Consume unhandled gamepad mouse events to prevent duplicate mouse actions
This commit is contained in:
@@ -1623,16 +1623,17 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
|||||||
switch (event.getActionMasked()) {
|
switch (event.getActionMasked()) {
|
||||||
case MotionEvent.ACTION_DOWN:
|
case MotionEvent.ACTION_DOWN:
|
||||||
context.inputMap |= ControllerPacket.TOUCHPAD_FLAG;
|
context.inputMap |= ControllerPacket.TOUCHPAD_FLAG;
|
||||||
|
sendControllerInputPacket(context);
|
||||||
break;
|
break;
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
case MotionEvent.ACTION_CANCEL:
|
case MotionEvent.ACTION_CANCEL:
|
||||||
context.inputMap &= ~ControllerPacket.TOUCHPAD_FLAG;
|
context.inputMap &= ~ControllerPacket.TOUCHPAD_FLAG;
|
||||||
|
sendControllerInputPacket(context);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendControllerInputPacket(context);
|
|
||||||
return !prefConfig.gamepadTouchpadAsMouse;
|
return !prefConfig.gamepadTouchpadAsMouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user