Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace MaaFramework.Binding;
/// <br/>| PostMessageWithCursorPos | Medium | Maybe | Briefly | Yes | Moves cursor to target position, then restores |
/// <br/>| SendMessageWithWindowPos | Medium | Maybe | No | Yes | Moves window to align target with cursor, then restores |
/// <br/>| PostMessageWithWindowPos | Medium | Maybe | No | Yes | Moves window to align target with cursor, then restores |
/// <br/>| AnchoredTouch | Medium | Maybe | No | Yes | Injects synthetic touch points, mouse only |
/// </code>
///
/// <para>Note:
Expand All @@ -40,8 +41,9 @@ namespace MaaFramework.Binding;
/// <br/>- "WithCursorPos" methods briefly move the cursor to target position, send message,
/// <br/> then restore cursor position. This "briefly" seizes the mouse but won't block user operations.
/// <br/>- "WithWindowPos" methods briefly move the window so the target aligns with the current cursor
/// <br/> position, send message, then restore the window position. The cursor is not moved.</para>
///
/// <br/> position, send message, then restore the window position. The cursor is not moved.
/// <br/>- "AnchoredTouch" injects synthetic touch points through <c>InjectSyntheticPointerInput</c>.
/// <br/> The cursor and foreground window are not changed. It only implements mouse operations.</para>
/// </summary>
public enum Win32InputMethod : System.UInt64
{
Expand All @@ -56,5 +58,6 @@ public enum Win32InputMethod : System.UInt64
PostMessageWithCursorPos = (1 << 6),
SendMessageWithWindowPos = (1 << 7),
PostMessageWithWindowPos = (1 << 8),
AnchoredTouch = (1 << 10),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): AnchoredTouch 被分配到了第 10 位(0x400),而现有输入方法通过第 8 位连续占用,导致第 9 位未被使用。原生控制器会原样接收此值,因此当该 ABI 值应为下一位时,新方法无法选择原生的 AnchoredTouch 实现。

触发条件: 当调用方为 Win32 控制器选择 Win32InputMethod.AnchoredTouch 时。

建议修复: 使用 (1 << 9),除非原生 ABI 有意保留第 9 位;在这种情况下,应针对原生枚举记录并验证该保留位。

Suggested change
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.

Suggested change
AnchoredTouch = (1 << 10),
AnchoredTouch = (1 << 9),

}

Loading