Skip to content

feat: wlroots use_win32_vk_code support#40

Merged
dongwlin merged 2 commits into
MaaXYZ:mainfrom
litwak913:wlr-vk
May 1, 2026
Merged

feat: wlroots use_win32_vk_code support#40
dongwlin merged 2 commits into
MaaXYZ:mainfrom
litwak913:wlr-vk

Conversation

@litwak913
Copy link
Copy Markdown
Contributor

@litwak913 litwak913 commented May 1, 2026

MaaXYZ/MaaFramework#1283

Summary by Sourcery

为 WlRoots 控制器新增可选的 Win32 虚拟键码支持,并更新构造函数接口文档。

New Features:

  • 通过新的构造函数选项,允许 WlRoots 控制器将按键事件视为 Win32 虚拟键码进行处理。

Enhancements:

  • 扩展 WlRoots 控制器创建 API 和原生绑定接口,使其接受 useWin32VkCode 标志。
  • 更新变更日志,说明新增的 WlRoots Win32 虚拟键码支持以及构造函数签名的变更。
Original summary in English

Summary by Sourcery

Add optional Win32 virtual key code support to the WlRoots controller and document the updated constructor interface.

New Features:

  • Allow WlRoots controllers to treat key events as Win32 virtual key codes via a new constructor option.

Enhancements:

  • Extend the WlRoots controller creation API and native binding to accept a useWin32VkCode flag.
  • Update the changelog to describe the new WlRoots Win32 virtual key code support and constructor signature change.

新功能:

  • 在创建 WlRoots 控制器时引入 useWin32VkCode 标志,以便可选地将按键事件视作 Win32 虚拟键码。

增强内容:

  • 扩展原生 WlRoots 控制器创建绑定,以接受新的 useWin32VkCode 选项。
  • 更新变更日志,在现有控制器接口变更的说明中,加入新的 WlRoots Win32 VK 键码支持的描述。
Original summary in English

Summary by Sourcery

为 WlRoots 控制器新增可选的 Win32 虚拟键码支持,并更新构造函数接口文档。

New Features:

  • 通过新的构造函数选项,允许 WlRoots 控制器将按键事件视为 Win32 虚拟键码进行处理。

Enhancements:

  • 扩展 WlRoots 控制器创建 API 和原生绑定接口,使其接受 useWin32VkCode 标志。
  • 更新变更日志,说明新增的 WlRoots Win32 虚拟键码支持以及构造函数签名的变更。
Original summary in English

Summary by Sourcery

Add optional Win32 virtual key code support to the WlRoots controller and document the updated constructor interface.

New Features:

  • Allow WlRoots controllers to treat key events as Win32 virtual key codes via a new constructor option.

Enhancements:

  • Extend the WlRoots controller creation API and native binding to accept a useWin32VkCode flag.
  • Update the changelog to describe the new WlRoots Win32 virtual key code support and constructor signature change.

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 - 我在这里给出了一些总体反馈:

  • NewWlRootsControllerMaaWlRootsControllerCreate 的函数签名修改以添加 useWin32VkCode 属于破坏性 API 变更;建议考虑新增一个构造函数,或者使用 options 模式,以保持现有调用端的兼容性。
  • 由于 useWin32VkCode 只是一个简单的布尔标志,从长期来看,将控制器配置归纳到一个结构体或使用函数式 options 可能更清晰,从而在后续增加更多标志时避免函数签名不断膨胀。
面向 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Changing `NewWlRootsController` and `MaaWlRootsControllerCreate` signatures to add `useWin32VkCode` is a breaking API change; consider introducing a new constructor or using an options pattern to keep existing call sites compatible.
- Since `useWin32VkCode` is a simple boolean flag, it may be clearer long term to group controller configuration into a struct or functional options to avoid signature creep as more flags are added.

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

Hey - I've left some high level feedback:

  • Changing NewWlRootsController and MaaWlRootsControllerCreate signatures to add useWin32VkCode is a breaking API change; consider introducing a new constructor or using an options pattern to keep existing call sites compatible.
  • Since useWin32VkCode is a simple boolean flag, it may be clearer long term to group controller configuration into a struct or functional options to avoid signature creep as more flags are added.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Changing `NewWlRootsController` and `MaaWlRootsControllerCreate` signatures to add `useWin32VkCode` is a breaking API change; consider introducing a new constructor or using an options pattern to keep existing call sites compatible.
- Since `useWin32VkCode` is a simple boolean flag, it may be clearer long term to group controller configuration into a struct or functional options to avoid signature creep as more flags are added.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional useWin32VkCode flag to the WlRoots controller constructor and propagates it through the Go native binding layer, with accompanying documentation/CI updates to reflect and validate the new API against MaaFramework releases.

Changes:

  • Extend the native binding signature for MaaWlRootsControllerCreate to accept useWin32VkCode.
  • Update NewWlRootsController to take and forward the new flag.
  • Document the constructor signature change in CHANGELOG.md and adjust CI to download a resolved MaaFramework release tag.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
internal/native/framework.go Updates the registered native function signature for WlRoots controller creation to include useWin32VkCode.
controller.go Extends NewWlRootsController API and forwards the new flag to the native constructor.
CHANGELOG.md Documents the WlRoots constructor signature update and the new Win32 VK keycode behavior option.
.github/workflows/test.yml Changes MaaFramework download to use a resolved release tag (via github-script) rather than latest/preRelease flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dongwlin dongwlin merged commit 38c7f6b into MaaXYZ:main May 1, 2026
10 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.

3 participants