moonlight-ios icon indicating copy to clipboard operation
moonlight-ios copied to clipboard

Add passthrough touch support for windows native multi-touch

Open ZigZagT opened this issue 9 months ago • 1 comments

Adding support for sending touch events to Sunshine hosts directly.

This has been asked in multiple issues (incomplete list)

  • https://github.com/moonlight-stream/moonlight-ios/issues/597
  • https://github.com/moonlight-stream/moonlight-ios/issues/596
  • https://github.com/moonlight-stream/moonlight-ios/issues/518

Summary of changes

  1. A new "passthrough touch events" option is added in settings when "Touchscreen" mode is on :
image

Once turned on, touch events will be routed to Sunshine hosts via the LiSendTouchEvent API, and appears as natively multi touch events on Windows.

  1. When passthrough mode is enabled, the pop-up keyboard would require 5 fingers tap to fire up. This avoids conflicting with windows native gestures. (According to the touch-gestures-for-windows, windows has native touch gestures use up to 4 fingers, so 5 fingers tap provides a good guarantee). Windows also offers a built-in on-screen touch keyboard when multi-touch events are received, making the pop-up keyboard less crucial than before.

  2. A performance tweak (turning off UIScrollView delaysContentTouches). While I was on this I noticed the "pin & pan & scroll" feature in absolute touch mode brings in unwanted delay due to the default settings of ScrollView, which might have caused the following issues regarding delays:

  • https://github.com/moonlight-stream/moonlight-ios/issues/496
  • https://github.com/moonlight-stream/moonlight-ios/issues/489 The delay It is pretty noticeable in windows paint app.

ZigZagT avatar May 21 '24 09:05 ZigZagT