Skip to content

feat(input): add configurable touchpad compatibility gestures - #359

Open
not-linyi wants to merge 1 commit into
qiin2333:masterfrom
not-linyi:feature/touchpad-compatibility
Open

feat(input): add configurable touchpad compatibility gestures#359
not-linyi wants to merge 1 commit into
qiin2333:masterfrom
not-linyi:feature/touchpad-compatibility

Conversation

@not-linyi

Copy link
Copy Markdown

Summary

  • add an opt-in compatibility device list for Android touchpads that stop producing usable input under Pointer Capture
  • translate raw touchpad pointer streams into tap, two-finger scrolling, horizontal scrolling, pinch-to-zoom, and configurable three-finger actions
  • add Windows-style touchpad preferences for tap behavior, scrolling direction, pinch, three-finger gestures, timeout, and movement tolerance
  • preserve the full multi-pointer stream at the Activity level and safely release held Ctrl/Alt state when gestures are cancelled or input capture is lost

Compatibility

This implementation contains no device-specific identifiers. It applies only to pointer devices explicitly selected by the user and uses standard Android multi-pointer MotionEvent sequences. Devices whose gestures are consumed by the system or exposed only through vendor-specific axes may still require separate handling.

Testing

  • ./gradlew.bat :app:testNonRootDebugUnitTest --rerun-tasks
  • ./gradlew.bat :app:assembleNonRootDebug
  • tested on a physical Android tablet with an attached touchpad
  • verified one-finger tap, two-finger vertical/horizontal scrolling, two-finger right click, pinch, and three-finger actions

Lint

./gradlew.bat :app:lintNonRootDebug still reports the repository's existing lint baseline (122 errors and 1672 warnings). The touchpad-specific files introduce no lint errors.

@Yundi339

Copy link
Copy Markdown
Collaborator

你们俩位的pr功能是不是重叠了 #348

@not-linyi

Copy link
Copy Markdown
Author

你们俩位的pr功能是不是重叠了 #348你们俩位的 pr 功能是不是重叠了 #348

我看了一下,应该不算
有部分功能交集,但实现路径和适用设备不同。#348 将 SOURCE_TOUCHPAD/evdev 原始接触帧通过新增协议发送给支持该协议的 Sunshine,实现原生精密触控板;本 PR 则针对以 SOURCE_MOUSE 上报标准多指 MotionEvent、且 Pointer Capture 后失效的设备,将手势转换为现有鼠标和键盘事件,不需要主机端或协议支持。
因此本 PR 可以作为不支持原生触控板协议及非 SOURCE_TOUCHPAD 设备的兼容回退方案。

@Yundi339

Copy link
Copy Markdown
Collaborator

不要用AI回复我

@Yundi339

Yundi339 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

这个PR的功能,只能作为一种兜底的备选。
另一个PR合入以后,如果对端sunshine不是最新版,就无法使用它,这时候你的这个方案就可以做兜底方案实现。

@not-linyi

Copy link
Copy Markdown
Author

这个PR的功能,只能作为一种兜底的备选。 另一个PR合入以后,如果对端sunshine不是最新版,就无法使用它,这时候你的这个方案就可以做兜底方案实现。

我语言组织能力不行,就让ai帮我组织一下了。
这个方案本来就是用来兜底的,我好久没更新sunshine,甚至我sunshine用的还是官方好久前的版本,懒得更新,我感觉对远程办公来说,原生Windows触控板体验没啥必要就是了,也没人用触控板来打游戏吧。
我的方案目前只在我的设备上进行了测试,我也不知道有没有新的bug,这个就是为了解决我买的官方键盘没法用触控板做的方案(某些第三方键盘都能用感觉我像个冤大头emmmmmm)

@Yundi339

Copy link
Copy Markdown
Collaborator

不好意思最近比较忙,这个pr想法上是没问题的,不过得等另一个触摸板PR合入以后,再进行调整,因为那个PR我们跟进了有一段时间了

@qiin2333
qiin2333 force-pushed the master branch 2 times, most recently from 85b5eb3 to a4d7ce0 Compare August 25, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants