Skip to content

feat: gamescope controller#1338

Draft
mx6436 wants to merge 11 commits into
MaaXYZ:mainfrom
mx6436:feat/gamescope-controller
Draft

feat: gamescope controller#1338
mx6436 wants to merge 11 commits into
MaaXYZ:mainfrom
mx6436:feat/gamescope-controller

Conversation

@mx6436
Copy link
Copy Markdown
Contributor

@mx6436 mx6436 commented May 19, 2026

已知问题:

  1. gamescope buffer size 与实际画面分辨率不一致,实为多轮 resize 的最大值
  2. node_id 每次运行都会变,无法持久化保存设置

由 Sourcery 提供的摘要

添加一个适用于 Linux 的新的 Gamescope 控制器,通过核心框架、本机控制单元和语言绑定进行串联,使用 PipeWire 进行屏幕捕获,使用 libei 进行输入注入,并附带相应的配置和文档更新。

新功能:

  • 引入一个 Gamescope 控制单元和框架控制器,通过 PipeWire 屏幕捕获和 libei 输入来控制运行在 Linux 上 Gamescope 微合成器中的应用程序。
  • 将 Gamescope 控制器暴露给 Python 和 Node.js 绑定,允许在这两种语言中创建和使用该控制器,并支持 Win32 VK 或 evdev 键码。

增强:

  • 扩展控制器发现和信息上报,以包含 Gamescope 特定字段,例如 node_id、EIS 套接字路径和键码模式。
  • 为可选的 Gamescope 控制器组件添加构建配置和 CMake 连接,与现有控制器并行集成。
  • 将 Vk 到 evdev 的键值翻译重构到一个共享的公共头文件中,以便多个控制器重用。

文档:

  • 添加英文文档章节,描述 Gamescope 控制方法、前置条件、配置参数、支持的操作和示例用法,并将其集成到统一接口概览中。
Original summary in English

Summary by Sourcery

Add a new Gamescope controller for Linux, wired through the core framework, native control unit, and language bindings, using PipeWire for screencapture and libei for input injection, with corresponding configuration and documentation updates.

New Features:

  • Introduce a Gamescope control unit and framework controller to control applications running in the Gamescope microcompositor on Linux via PipeWire screencap and libei input.
  • Expose the Gamescope controller to Python and Node.js bindings, allowing creation and use from both languages with support for Win32 VK or evdev keycodes.

Enhancements:

  • Extend controller discovery and info reporting to include Gamescope-specific fields such as node_id, EIS socket path, and keycode mode.
  • Add build configuration and CMake wiring for the optional Gamescope controller component alongside existing controllers.
  • Refactor Vk-to-evdev key translation into a shared common header for reuse by multiple controllers.

Documentation:

  • Add English documentation sections describing the Gamescope control method, prerequisites, configuration parameters, supported operations, and example usage, and integrate it into the integrated interface overview.

mx6436 added 11 commits May 19, 2026 15:27
- Extract VkToEvdev.h to shared Common include
- Add CMake build scaffolding for MaaGamescopeControlUnit
- Declare GamescopeControlUnitAPI C header and implement exports
- Update MaaController.h, ControlUnitAPI.h for Gamescope support
- Add module export in MaaFramework.cppm
PipeWire-based screen capture using pw_thread_loop, supporting
BGR/RGB/RGBA/BGRA/YUY2 formats with SPA pod negotiation.
libei-based input sender supporting pointer, keyboard, and scroll events
via ei_device_* primitives with synchronous poll_and_dispatch loop.
Control unit manager that composes PipeWireScreencap and EiInput,
registered through the LibraryHolder factory pattern.
Remove verbose prerequisite, setup, supported/unsupported operations,
and code example sections from the Gamescope docs. Retain only the
essential API parameter descriptions and keyboard input notice.
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.

1 participant