Skip to content

fix: respect wlroots hotkey keycode mode - #293

Open
mx6436 wants to merge 1 commit into
MistEO:mainfrom
mx6436:fix/wlroots-hotkey
Open

fix: respect wlroots hotkey keycode mode#293
mx6436 wants to merge 1 commit into
MistEO:mainfrom
mx6436:fix/wlroots-hotkey

Conversation

@mx6436

@mx6436 mx6436 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

修复在 wlroots 已经启用 use_win32_vk_code 的情况下,仍然为 hotkey 生成 evdev 键码的问题

close MaaEnd/MaaEnd#4869

Summary by Sourcery

Bug Fixes:

  • 修复在 wlroots 控制器配置为使用 Win32 VK 代码时,使用 evdev 键码生成快捷键的问题。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Fix hotkey generation using evdev keycodes when the wlroots controller is configured to use Win32 VK codes.

Summary by Sourcery

错误修复:

  • 修复在 wlroots 控制器配置为使用 Win32 VK 代码时,使用 evdev 键码生成热键的问题。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • Fix hotkey generation using evdev keycodes when the wlroots controller is configured to use Win32 VK codes.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 我在这里提供了一些高层面的反馈:

  • controllerType 规范化逻辑(将带有 use_win32_vk_code 的 WlRoots 映射到 "Win32")现在嵌入在这里;建议把这部分提取到一个共享的 helper 中,这样以后任何依赖 controller 类型的逻辑都可以使用单一且一致的“真值来源”。
  • 与其在代码中硬编码字符串字面量 "WlRoots" 和 "Win32",不如考虑使用现有的枚举或集中定义的 controller 类型常量,以减少拼写错误的风险并简化未来的重构。
给 AI Agents 的提示
Please address the comments from this code review:

## Overall Comments
- The controllerType normalization logic (mapping WlRoots with use_win32_vk_code to 'Win32') is now embedded here; consider extracting this into a shared helper so that any future logic relying on controller types uses a single, consistent source of truth.
- Instead of hardcoding the string literals 'WlRoots' and 'Win32', consider using existing enums or centralized constants for controller types to reduce the risk of typos and simplify future refactors.

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

Hey - I've left some high level feedback:

  • The controllerType normalization logic (mapping WlRoots with use_win32_vk_code to 'Win32') is now embedded here; consider extracting this into a shared helper so that any future logic relying on controller types uses a single, consistent source of truth.
  • Instead of hardcoding the string literals 'WlRoots' and 'Win32', consider using existing enums or centralized constants for controller types to reduce the risk of typos and simplify future refactors.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The controllerType normalization logic (mapping WlRoots with use_win32_vk_code to 'Win32') is now embedded here; consider extracting this into a shared helper so that any future logic relying on controller types uses a single, consistent source of truth.
- Instead of hardcoding the string literals 'WlRoots' and 'Win32', consider using existing enums or centralized constants for controller types to reduce the risk of typos and simplify future refactors.

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.

@mx6436
mx6436 marked this pull request as draft July 21, 2026 14:01
@mx6436
mx6436 force-pushed the fix/wlroots-hotkey branch from 6681614 to e311e8d Compare August 8, 2026 19:33
@mx6436
mx6436 marked this pull request as ready for review August 8, 2026 19:36

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 我已经审查了你的修改,效果很棒!


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

Hey - I've reviewed your changes and they look great!


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.

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.

[Wlroots] Keymap 热键渲染输出 evdev 键码,与 use_win32_vk_code 语义冲突导致按键错发

1 participant