[收集反馈]添加游戏触控板模式,防止游戏时误触#302
Draft
aningQwQ wants to merge 7 commits into
Draft
Conversation
- Add game touchpad mode to prevent accidental clicks while moving - Add settings for disabling left click, right click, scroll, and keyboard toggle - Implement touch event hijacking at the final output stage
- Add GTM (Game Touchpad Mode) button to device key selection UI - Add English/Chinese string resources - Add GTM send event handler in ElementController
Author
|
https://wwbft.lanzouw.com/iRoh03p2jgwd |
Author
|
当前已完成所有底层拦截,正在完成ui逻辑部分的修改,准备添加一个新模式,与触控板模式 / 多点触控模式等并列 |
|
大佬厉害,用起来暂时没什么问题 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#291
本 PR 添加了游戏触控板模式,允许用户在触控板模式下选择性禁用部分手势(左键、右键、滚轮、键盘切换),防止在触屏游戏中意外误触。
变更内容
新增功能
GTM)技术实现
RelativeTouchContext.ktTouchInputHandler.kt涉及文件
PreferenceConfiguration.kt- 配置项定义TouchInputHandler.kt- 右键及键盘切换拦截RelativeTouchContext.kt- 左键及滚轮拦截preferences.xml- 设置界面VirtualControlAdapter.java- 王冠键 GTM 处理strings.xml- 字符串资源测试情况
真机 Android 15 测试通过
左键可正常禁用
右键可正常禁用
滚轮可正常禁用
键盘切换有问题(似乎砍废了
王冠键快速切换正常
普通触控板模式不受影响
此功能仅在设置中开启「游戏触控板模式」或 王冠快捷键启用 后生效
设计方向讨论
关于设计方向想听听维护者的意见:
当前实现(附庸模式)
做成触控板模式的附庸:保留单一的“触控板模式”,内部增加一个“防误触开关”。用户需要先切换到触控板模式,再按王冠键开启/关闭防误触(禁用手势)。
建议改为独立模式
做成独立的模式:在触控板模式之外,单独提供一个“游戏触控板模式”,用户可通过王冠键一键切换到触控板模式 / 游戏触控板模式 / 多点触控模式。
个人倾向:当前使用的是附庸模式,但我更偏向于改成独立模式。原因:
欢迎各位提出意见!