Repository navigation
feat(win32): 新增 AnchoredTouch 输入方式 - #31
Conversation
There was a problem hiding this comment.
你好——我发现了 1 个问题
面向 AI 代理的提示
请处理本次代码审查中的评论:
## 单独评论
### 评论 1
<location path="src/MaaFramework.Binding/Enums/Controllers/Win32InputMethod.cs" line_range="61" />
<code_context>
PostMessageWithCursorPos = (1 << 6),
SendMessageWithWindowPos = (1 << 7),
PostMessageWithWindowPos = (1 << 8),
+ AnchoredTouch = (1 << 10),
}
</code_context>
<issue_to_address>
**issue (bug_risk):** AnchoredTouch 被分配到了第 10 位(`0x400`),而现有输入方法通过第 8 位连续占用,导致第 9 位未被使用。原生控制器会原样接收此值,因此当该 ABI 值应为下一位时,新方法无法选择原生的 AnchoredTouch 实现。
**触发条件:** 当调用方为 Win32 控制器选择 `Win32InputMethod.AnchoredTouch` 时。
**建议修复:** 使用 `(1 << 9)`,除非原生 ABI 有意保留第 9 位;在这种情况下,应针对原生枚举记录并验证该保留位。
```suggestion
AnchoredTouch = (1 << 9),
```
</issue_to_address>帮我变得更有用!请在每条评论上点击 👍 或 👎,我会利用这些反馈来改进审查结果。
Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/MaaFramework.Binding/Enums/Controllers/Win32InputMethod.cs" line_range="61" />
<code_context>
PostMessageWithCursorPos = (1 << 6),
SendMessageWithWindowPos = (1 << 7),
PostMessageWithWindowPos = (1 << 8),
+ AnchoredTouch = (1 << 10),
}
</code_context>
<issue_to_address>
**issue (bug_risk):** AnchoredTouch is assigned bit 10 (`0x400`) while the existing input methods occupy consecutive bits through bit 8, leaving bit 9 unused. The native controller receives this value unchanged, so the new method does not select the native AnchoredTouch implementation when that ABI value is the next bit.
**Triggers:** When a caller selects `Win32InputMethod.AnchoredTouch` for a Win32 controller.
**Suggested fix:** Use `(1 << 9)` unless bit 9 is intentionally reserved by the native ABI, in which case document and verify that reservation against the native enum.
```suggestion
AnchoredTouch = (1 << 9),
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| PostMessageWithCursorPos = (1 << 6), | ||
| SendMessageWithWindowPos = (1 << 7), | ||
| PostMessageWithWindowPos = (1 << 8), | ||
| AnchoredTouch = (1 << 10), |
There was a problem hiding this comment.
issue (bug_risk): AnchoredTouch 被分配到了第 10 位(0x400),而现有输入方法通过第 8 位连续占用,导致第 9 位未被使用。原生控制器会原样接收此值,因此当该 ABI 值应为下一位时,新方法无法选择原生的 AnchoredTouch 实现。
触发条件: 当调用方为 Win32 控制器选择 Win32InputMethod.AnchoredTouch 时。
建议修复: 使用 (1 << 9),除非原生 ABI 有意保留第 9 位;在这种情况下,应针对原生枚举记录并验证该保留位。
| AnchoredTouch = (1 << 10), | |
| AnchoredTouch = (1 << 9), |
Original comment in English
issue (bug_risk): AnchoredTouch is assigned bit 10 (0x400) while the existing input methods occupy consecutive bits through bit 8, leaving bit 9 unused. The native controller receives this value unchanged, so the new method does not select the native AnchoredTouch implementation when that ABI value is the next bit.
Triggers: When a caller selects Win32InputMethod.AnchoredTouch for a Win32 controller.
Suggested fix: Use (1 << 9) unless bit 9 is intentionally reserved by the native ABI, in which case document and verify that reservation against the native enum.
| AnchoredTouch = (1 << 10), | |
| AnchoredTouch = (1 << 9), |
Sourcery 总结
将 AnchoredTouch 添加为 Win32 输入方法,用于仅通过鼠标注入合成触摸。
新功能:
文档:
Original summary in English
Summary by Sourcery
Add AnchoredTouch as a Win32 input method for mouse-only synthetic touch injection.
New Features:
Documentation: