Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持触控输入 #900

Merged
merged 32 commits into from
May 9, 2024
Merged

支持触控输入 #900

merged 32 commits into from
May 9, 2024

Conversation

Blinue
Copy link
Owner

@Blinue Blinue commented Apr 29, 2024

Close #218

添加 TouchHelper.exe 用于调用 MagSetInputTransform。为了获得 UIAccess 权限,当启用触控支持时执行以下操作:

  1. 将自签名证书添加到受信任的根证书颁发机构存储。
  2. 将 TouchHelper.exe 复制到 System32\Magpie 文件夹。

关闭触控支持将撤销这些操作。

自签名证书位于 certs\Magpie.pfx,出于安全考虑,密码不会公开,只能通过 CI 签名。如果自行编译,启用触控支持选项无法使用,除非编译者自己提供证书。

@Blinue Blinue added the enhancement New feature or request label Apr 29, 2024
@Blinue
Copy link
Owner Author

Blinue commented May 9, 2024

如何屏蔽黑边上的点击

直接将 srcRect 映射到 destRect 是天真的想法。似乎可以创建一个全屏的背景窗口来屏蔽黑边,就像 fix/touchTransform 分支所做的,此方案的问题是无法解决源窗口和黑边的重叠部分。作为黑边,本应拦截用户点击,但这也拦截了对源窗口的操作;若是不拦截会导致在黑边上可以操作源窗口。

现在的方案是:将源窗口和其周围映射到整个缩放窗口,并在源窗口四周创建背景窗口拦截对黑边的点击。注意这些背景窗口不能由 TouchHelper.exe 创建,因为它有 UIAccess 权限,创建的窗口会遮盖缩放窗口。

@Blinue Blinue merged commit 3ce10c2 into dev May 9, 2024
4 checks passed
@Blinue Blinue deleted the touch branch May 9, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

使用触摸屏时,触控区域会维持在放大前原窗口的位置
1 participant