Skip to content

[Bug] Win32 input 未适配 Windows 左右键互换(SM_SWAPBUTTON) #1323

@MistEO

Description

@MistEO

问题

MaaFramework v5.10.4 Win32 输入层把 contact=0/1 直接硬编码为左/右键消息或 SendInput 标志,没有读取系统 SM_SWAPBUTTON。Windows 开启「左右键互换」后,Win32-FrontSeizeInput)和 Win32-Window-BackgroundMessageInput with_window_pos)都会点击失效。

代码位置

  • source/MaaWin32ControlUnit/Input/InputUtils.h:63-213WM_LBUTTON*/WM_RBUTTON* 硬编码
  • source/MaaWin32ControlUnit/Input/SeizeInput.cpp:60-90, 129-152MOUSEEVENTF_LEFT*/RIGHT* 硬编码
  • source/MaaWin32ControlUnit/Input/MessageInput.cpp:872-950, 1011-1065:同上

来源

MaaEnd/MaaEnd#2825 — bot 分析链路已完整定位到 Win32 输入层。用户表现:

  • 电脑端-前台/电脑端-后台(都是 Win32)点击失败
  • 电脑端-默认(也是 Win32 的 MessageInput with_cursor_pos)反而能跑通

修复方向

建议在 InputUtils.h 统一做逻辑主键/副键 remap:

  1. 初始化读一次 GetSystemMetrics(SM_SWAPBUTTON) 并输出日志
  2. 按该值在底层对 contact 0/1 做 remap,避免每个 input backend 各修各的
  3. 覆盖 MessageInput + SeizeInput

补充

SM_SWAPBUTTON 的读取要在与 MaaFW agent 相同的 interactive desktop session,服务场景下要留心

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions