Skip to content

feat: macos 支持 contact 区分按键#1218

Merged
MistEO merged 4 commits intoMaaXYZ:mainfrom
YJBeetle:MacOSContactSupport
Mar 21, 2026
Merged

feat: macos 支持 contact 区分按键#1218
MistEO merged 4 commits intoMaaXYZ:mainfrom
YJBeetle:MacOSContactSupport

Conversation

@YJBeetle
Copy link
Copy Markdown
Contributor

@YJBeetle YJBeetle commented Mar 19, 2026

才发现5.0有contact都没注意 , 参照了win32的逻辑补上去

Summary by Sourcery

为 macOS 控制器添加通过接触 ID 区分鼠标按键的支持,并更新文档以说明 macOS 中接触与按键的映射关系。

New Features:

  • 为 PostToPid 和全局输入处理程序添加支持,将 macOS 触控接触 ID 映射到不同的鼠标按键。

Enhancements:

  • 引入共享工具,用于将接触 ID 转换为 macOS 鼠标事件类型和按键,并包含边界检查和错误日志记录。

Documentation:

  • 在英文和中文的流水线文档及集成界面文档中记录 macOS 控制器接触到鼠标按键的映射关系。

Tests:

  • 扩展 macOS 测试流水线配置,以覆盖基于接触的鼠标按键新行为。
Original summary in English

Summary by Sourcery

Add macOS controller support for distinguishing mouse buttons via contact IDs and align documentation to describe macOS contact-to-button mapping.

New Features:

  • Support mapping macOS touch contact IDs to different mouse buttons for both PostToPid and global input handlers.

Enhancements:

  • Introduce a shared utility for translating contact IDs into macOS mouse event types and buttons, with bounds checking and error logging.

Documentation:

  • Document macOS controller contact-to-mouse-button mapping in both English and Chinese pipeline and integrated interface docs.

Tests:

  • Extend macOS test pipeline configuration to cover the new contact-based mouse button behavior.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些总体反馈:

  • InputUtils.h 中的三个 contact_to_mouse_*_info 函数在 switch 逻辑上几乎完全一致;可以考虑通过参数化基础事件(按下/拖拽/抬起)或使用一个小型查找表来合并它们,以减少重复代码,并让未来的修改集中在一个地方。
  • 对于 contact out of range 的错误日志,包含允许的接触范围(例如 0-2)或控制器类型可能会更有帮助,这样可以更容易排查配置相关的问题。
给 AI 代理的提示词
Please address the comments from this code review:

## Overall Comments
- The three `contact_to_mouse_*_info` functions in `InputUtils.h` share almost identical switch logic; consider consolidating them by parameterizing the base event (down/drag/up) or using a small lookup table to reduce duplication and keep future changes in one place.
- For the `contact out of range` error logs, it may be helpful to include the allowed contact range (e.g., `0-2`) or the controller type to make debugging configuration issues easier.

Sourcery 对开源项目是免费的——如果你觉得我们的代码审查对你有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进之后的代码审查。
Original comment in English

Hey - I've left some high level feedback:

  • The three contact_to_mouse_*_info functions in InputUtils.h share almost identical switch logic; consider consolidating them by parameterizing the base event (down/drag/up) or using a small lookup table to reduce duplication and keep future changes in one place.
  • For the contact out of range error logs, it may be helpful to include the allowed contact range (e.g., 0-2) or the controller type to make debugging configuration issues easier.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The three `contact_to_mouse_*_info` functions in `InputUtils.h` share almost identical switch logic; consider consolidating them by parameterizing the base event (down/drag/up) or using a small lookup table to reduce duplication and keep future changes in one place.
- For the `contact out of range` error logs, it may be helpful to include the allowed contact range (e.g., `0-2`) or the controller type to make debugging configuration issues easier.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MistEO MistEO merged commit 32d201f into MaaXYZ:main Mar 21, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants