feat(input): add cursor capture options#681
Conversation
Summary by CodeRabbit发布说明
总体说明该 PR 实现了鼠标光标采集功能的完整配置链路:从后端 C++ 配置结构体定义,到运行时参数应用,再到 Windows 平台视频采集逻辑的集成,最后在前端 Web UI 提供用户控制,并为全部语言包添加本地化支持。 变更内容鼠标光标采集功能
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src_assets/common/assets/web/public/assets/locale/en_GB.json`:
- Line 446: The localization key output_name_windows has an unnatural English
value ("Display device specify"); update its value to a clear, readable
label—replace the string for output_name_windows with a natural noun phrase such
as "Display device selection" (or a concise label like "Select display device")
to improve UI clarity.
In `@src_assets/common/assets/web/public/assets/locale/en_US.json`:
- Line 446: The string for the localization key "output_name_windows" has
awkward English ("Display device specify"); update its value to a more natural
phrase by replacing the current value with "Display device selection" for the
"output_name_windows" key so the English copy reads correctly.
In `@src_assets/common/assets/web/public/assets/locale/en.json`:
- Line 472: Replace the awkward string for the localization key
output_name_windows so it reads as a clear noun label; update the value from
"Display Device Specify" to a natural, unambiguous label such as "Display Device
ID" by editing the JSON entry for output_name_windows.
In `@src_assets/common/assets/web/public/assets/locale/sv.json`:
- Line 434: Change the Swedish translation for the key output_name_windows
because "Utdatanamn" (output name) is semantically incorrect; update the value
in src_assets/common/assets/web/public/assets/locale/sv.json for the key
"output_name_windows" to a phrase that conveys "display device ID" (e.g., "Visa
enhets‑ID" or "Enhets‑ID för visning") so it matches the field's actual meaning.
In `@src_assets/common/assets/web/public/assets/locale/tr.json`:
- Line 434: The Turkish translation for the key output_name_windows is
semantically incorrect ("Çıktı Adı" = "Output Name"); update the value for the
JSON key "output_name_windows" to a Turkish phrase that conveys "display device
ID", e.g., replace "Çıktı Adı" with "Görüntü Aygıtı Kimliği" (or "Görüntü Aygıtı
ID'si") so it clearly represents the Windows display device identifier.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5fc1048f-e09e-419b-aae5-d2df3b2fb258
📒 Files selected for processing (25)
src/config.cppsrc/config.hsrc/platform/windows/display_vram.cppsrc_assets/common/assets/web/composables/useConfig.jssrc_assets/common/assets/web/configs/tabs/Inputs.vuesrc_assets/common/assets/web/public/assets/locale/bg.jsonsrc_assets/common/assets/web/public/assets/locale/cs.jsonsrc_assets/common/assets/web/public/assets/locale/de.jsonsrc_assets/common/assets/web/public/assets/locale/en.jsonsrc_assets/common/assets/web/public/assets/locale/en_GB.jsonsrc_assets/common/assets/web/public/assets/locale/en_US.jsonsrc_assets/common/assets/web/public/assets/locale/es.jsonsrc_assets/common/assets/web/public/assets/locale/fr.jsonsrc_assets/common/assets/web/public/assets/locale/it.jsonsrc_assets/common/assets/web/public/assets/locale/ja.jsonsrc_assets/common/assets/web/public/assets/locale/ko.jsonsrc_assets/common/assets/web/public/assets/locale/pl.jsonsrc_assets/common/assets/web/public/assets/locale/pt.jsonsrc_assets/common/assets/web/public/assets/locale/pt_BR.jsonsrc_assets/common/assets/web/public/assets/locale/ru.jsonsrc_assets/common/assets/web/public/assets/locale/sv.jsonsrc_assets/common/assets/web/public/assets/locale/tr.jsonsrc_assets/common/assets/web/public/assets/locale/uk.jsonsrc_assets/common/assets/web/public/assets/locale/zh.jsonsrc_assets/common/assets/web/public/assets/locale/zh_TW.json
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
src/**/*.{cpp,c,h}
⚙️ CodeRabbit configuration file
src/**/*.{cpp,c,h}: Sunshine 核心 C++ 源码,自托管游戏串流服务器。审查要点:内存安全、 线程安全、RAII 资源管理、安全漏洞。注意预处理宏控制的平台相关代码。
Files:
src/config.hsrc/config.cppsrc/platform/windows/display_vram.cpp
src_assets/**/*.{vue,js,html}
⚙️ CodeRabbit configuration file
src_assets/**/*.{vue,js,html}: 基于 Vue.js 的 Web 配置面板。审查 XSS/CSRF 安全性、 组件设计、状态管理和可访问性。
Files:
src_assets/common/assets/web/composables/useConfig.jssrc_assets/common/assets/web/configs/tabs/Inputs.vue
src/platform/**
⚙️ CodeRabbit configuration file
src/platform/**: 平台抽象层代码(Windows/Linux/macOS)。确保各平台实现一致, 注意 Windows API 调用的错误处理和资源释放。
Files:
src/platform/windows/display_vram.cpp
🔇 Additional comments (23)
src/config.h (1)
117-117: LGTM!src/config.cpp (1)
453-453: LGTM!Also applies to: 1306-1310
src_assets/common/assets/web/composables/useConfig.js (1)
46-46: LGTM!src_assets/common/assets/web/configs/tabs/Inputs.vue (1)
439-449: LGTM!src/platform/windows/display_vram.cpp (1)
2827-2832: LGTM!src_assets/common/assets/web/public/assets/locale/bg.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/cs.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/de.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/en.json (1)
47-54: LGTM!Also applies to: 181-189, 192-192, 195-200, 247-248, 258-259, 272-283, 319-320, 562-578
src_assets/common/assets/web/public/assets/locale/en_GB.json (1)
47-54: LGTM!Also applies to: 228-259
src_assets/common/assets/web/public/assets/locale/en_US.json (1)
47-54: LGTM!Also applies to: 228-259
src_assets/common/assets/web/public/assets/locale/es.json (1)
47-54: LGTM!Also applies to: 234-235, 433-434
src_assets/common/assets/web/public/assets/locale/fr.json (1)
47-54: LGTM!Also applies to: 234-235, 433-434
src_assets/common/assets/web/public/assets/locale/it.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/ja.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/ko.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/pl.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/pt.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/pt_BR.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/ru.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/uk.json (1)
47-54: LGTM!Also applies to: 234-235, 434-434
src_assets/common/assets/web/public/assets/locale/zh.json (1)
47-54: LGTM!Also applies to: 181-189, 192-192, 195-200, 258-259, 272-283, 319-320, 472-472, 562-579
src_assets/common/assets/web/public/assets/locale/zh_TW.json (1)
47-54: LGTM!Also applies to: 234-235, 248-259, 446-446
| "output_name_unix": "Display number", | ||
| "output_name_windows": "Display device specify", | ||
| "output_name_vdd_option": "Just gimme VDD~ ✨", | ||
| "output_name_windows": "Display device specify", |
There was a problem hiding this comment.
output_name_windows 文案语法不正确,建议改为可读标签。
当前 "Display device specify" 不符合英语表达,建议改成名词短语(例如 Display device selection),避免界面歧义。
✏️ 建议修改
- "output_name_windows": "Display device specify",
+ "output_name_windows": "Display device selection",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "output_name_windows": "Display device specify", | |
| "output_name_windows": "Display device selection", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src_assets/common/assets/web/public/assets/locale/en_GB.json` at line 446,
The localization key output_name_windows has an unnatural English value
("Display device specify"); update its value to a clear, readable label—replace
the string for output_name_windows with a natural noun phrase such as "Display
device selection" (or a concise label like "Select display device") to improve
UI clarity.
| "output_name_unix": "Display number", | ||
| "output_name_windows": "Display device specify", | ||
| "output_name_vdd_option": "Just gimme VDD~ ✨", | ||
| "output_name_windows": "Display device specify", |
There was a problem hiding this comment.
output_name_windows 英文文案建议修正语法。
"Display device specify" 表达不自然,建议改为 "Display device selection"。
✏️ 建议修改
- "output_name_windows": "Display device specify",
+ "output_name_windows": "Display device selection",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "output_name_windows": "Display device specify", | |
| "output_name_windows": "Display device selection", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src_assets/common/assets/web/public/assets/locale/en_US.json` at line 446,
The string for the localization key "output_name_windows" has awkward English
("Display device specify"); update its value to a more natural phrase by
replacing the current value with "Display device selection" for the
"output_name_windows" key so the English copy reads correctly.
| "output_name_unix": "Display number", | ||
| "output_name_windows": "Display Device Specify", | ||
| "output_name_vdd_option": "Just gimme VDD~ ✨", | ||
| "output_name_windows": "Display Device Specify", |
There was a problem hiding this comment.
修正配置项文案语义错误
Line 472 的 output_name_windows 为 “Display Device Specify”,语义和语法都不自然,容易让用户误解字段用途。建议改为明确的名词标签(如 Display Device ID)。
💡 建议修改
- "output_name_windows": "Display Device Specify",
+ "output_name_windows": "Display Device ID",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "output_name_windows": "Display Device Specify", | |
| "output_name_windows": "Display Device ID", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src_assets/common/assets/web/public/assets/locale/en.json` at line 472,
Replace the awkward string for the localization key output_name_windows so it
reads as a clear noun label; update the value from "Display Device Specify" to a
natural, unambiguous label such as "Display Device ID" by editing the JSON entry
for output_name_windows.
| "output_name_unix": "Visa nummer", | ||
| "output_name_windows": "Utdatanamn", | ||
| "output_name_vdd_option": "Jag vill ha VDD ~ ✨", | ||
| "output_name_windows": "Utdatanamn", |
There was a problem hiding this comment.
output_name_windows 瑞典语语义偏差,建议改为“显示设备 ID”相关表述。
Line 434 目前是 “Utdatanamn”(输出名称),与该字段实际含义(显示设备标识)不一致,可能误导用户配置目标设备。
建议修复
- "output_name_windows": "Utdatanamn",
+ "output_name_windows": "Skärmenhets-ID",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "output_name_windows": "Utdatanamn", | |
| "output_name_windows": "Skärmenhets-ID", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src_assets/common/assets/web/public/assets/locale/sv.json` at line 434,
Change the Swedish translation for the key output_name_windows because
"Utdatanamn" (output name) is semantically incorrect; update the value in
src_assets/common/assets/web/public/assets/locale/sv.json for the key
"output_name_windows" to a phrase that conveys "display device ID" (e.g., "Visa
enhets‑ID" or "Enhets‑ID för visning") so it matches the field's actual meaning.
| "output_name_unix": "Ekran numarası", | ||
| "output_name_windows": "Çıktı Adı", | ||
| "output_name_vdd_option": "VDD istiyorum, bitti ~ ✨", | ||
| "output_name_windows": "Çıktı Adı", |
There was a problem hiding this comment.
output_name_windows 土耳其语翻译语义不准确。
Line 434 的 “Çıktı Adı” 更像“输出名称”,但该项实际是 Windows 显示设备标识字段,建议改成“显示设备 ID”语义以避免误解。
建议修复
- "output_name_windows": "Çıktı Adı",
+ "output_name_windows": "Ekran Aygıtı Kimliği",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "output_name_windows": "Çıktı Adı", | |
| "output_name_windows": "Ekran Aygıtı Kimliği", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src_assets/common/assets/web/public/assets/locale/tr.json` at line 434, The
Turkish translation for the key output_name_windows is semantically incorrect
("Çıktı Adı" = "Output Name"); update the value for the JSON key
"output_name_windows" to a Turkish phrase that conveys "display device ID",
e.g., replace "Çıktı Adı" with "Görüntü Aygıtı Kimliği" (or "Görüntü Aygıtı
ID'si") so it clearly represents the Windows display device identifier.
此修改仅对已有的 显示/隐藏光标 快捷键 ctrl + shift + alt + N进行可配置。
目前修复VDD光标不可见的问题,在此#660