Repository navigation
Conversation
Windows 本机的资源管理器会在应用之前处理 Win 键,插件又从普通按键路径把它 转发给远端,单按 Win 时本机和远端的开始菜单一起弹出(#174)。 新增「体验」页设置 windowsKeys(仅 Windows 声明),对应 mstsc / RDCMan 的 「应用 Windows 组合键」:remote(默认)、fullscreen(仅宿主窗口全屏时)、local。 - remote/fullscreen:桌面在活动的前台窗口中获得焦点期间安装 WH_KEYBOARD_LL 钩子,只截 Win、按住 Win 时的所有键、Alt+Tab、Alt+Esc、Ctrl+Esc、 Ctrl+Shift+Esc,本机吞掉并按扫描码发给远端;失焦、失活、切换标签、退出全屏、 关闭时卸下并释放远端仍按住的键。其他按键仍走 Avalonia 路径。 - 钩子未安装时 Win 键(及按住 Win 时的键)不再从普通路径转发,只归本机。 - Ctrl+Alt+Del 与 Win+L 无法挂钩,仍由远程按键悬浮球发送。 测试覆盖捕获规则、模式与窗口状态、设置解析与声明; VELA_RDP_KEYBOARD_HOOK_TEST=1 时用 SendInput 验证真实钩子(Windows 11 本机通过)。 Closes #174
ScanCodesMatchTheAvaloniaKeyPath 用了按当前平台取码的 RdpInput.ScanCode(key),macOS 上 Command(MetaLeft)按 Ctrl 发送(0x1d),与钩子给出的 Win 扫描码 0x15b 不等,两个 macOS 任务因此失败。钩子只在 Windows 运行,改为固定按 Windows 映射比较。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #174
问题
Windows 本机的资源管理器会在应用之前处理 Win 键,插件又从普通按键路径把它转发给远端,单按 Win 时本机和远端的开始菜单一起弹出;再按一次两边状态错开(一边关、一边开)。
改动
「体验」页新增 Windows 组合键(
windowsKeys,仅 Windows 声明),对应 mstsc / RDCMan 的「应用 Windows 组合键」:remote(默认)fullscreenremote,否则同locallocalRdpWindowsKeys.cs:纯逻辑RdpWindowsKeyCapture(截获规则)+RdpWindowsKeyboardHook(WH_KEYBOARD_LL,LibraryImport+UnmanagedCallersOnly)。只截 Win、按住 Win 时的所有键、Alt+Tab、Alt+Esc、Ctrl+Esc、Ctrl+Shift+Esc,本机吞掉并按扫描码发给远端;捕获新按键前核对前台窗口,已截下的键的抬起无论如何都转给远端,不粘键。RdpDesktopControl.WindowsKeys.cs:焦点 / 窗口激活 / 窗口状态 / 挂载 / 释放时安装或卸下钩子,卸下时释放远端仍按住的键。钩子未安装时 Win 键(及按住 Win 时的键)不再从 Avalonia 路径转发,只归本机。测试
RdpWindowsKeysTests:捕获规则、前台判断、ReleaseAll、扫描码一致性、模式 × 窗口状态、设置解析与声明。RdpHeadlessTests:Windows 上 Win / Win+D 不再走普通路径(其他平台仍成对发送扫描码);无头窗口不安装钩子。原ShortcutsAndNavigationKeepPhysicalKeyPairs的 Meta+D 用例移入该平台相关测试。RealHookCapturesInjectedWindowsKeys(需VELA_RDP_KEYBOARD_HOOK_TEST=1):安装真实钩子,SendInput 注入 Win、Win+F24,验证全部转给远端且本机未看到 Win 键 —— Windows 11 本机通过。测试工程为此开启AllowUnsafeBlocks。文档
配套文档 PR:VelaShellLabs/velashell-docs#238(zh / en 同步),两个 PR 一起合。