fix(windows): 修正 LeftOption 映射到左 Alt#382
Merged
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Reviewer Guide 🔍(Review updated until commit 941542c)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit 9cdb58d |
|
Persistent review updated to latest commit 941542c |
H-Chris233
approved these changes
May 9, 2026
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.
User description
概要
修复 #225:Windows 上
LeftOption不应匹配右 Alt /AltRight。本次修复包含两条路径:
修正 window hotkey fallback:
LeftOption匹配AltLeftLeftOption不再匹配AltRightRightOption/RightAlt仍匹配AltRight修正 Windows low-level keyboard hook:
VK_LMENULeftOption映射到VK_LMENURightOption/RightAlt保持映射到VK_RMENU同时补充回归测试,覆盖左右 Alt 不应互相串键。
Fixes #225.
原因
修复前,Windows 代码里存在历史折叠逻辑:
LeftOption被复用到RightAlt / VK_RMENULeftOption -> AltRight当作正确行为这导致用户选择
LeftOption后,实际需要按右 Alt / AltGr 才会触发;按左 Alt 不触发。修改内容
coordinator.rs
LeftOptionfallback 从AltRight改为AltLeftLeftOption + AltLeft为正例LeftOption + AltRight为反例hotkey.rs
VK_LMENU = 0xA4LeftOption从VK_RMENU改为VK_LMENURightOption/RightAlt使用VK_RMENUPR Type
Bug fix, Tests
Description
Fix LeftOption to match AltLeft in window key matcher
Map LeftOption to VK_LMENU in low-level hook; add VK_LMENU constant
Update coordinator tests and add hotkey tests for left/right Alt separation
Fixes fix(windows): LeftOption fallback 不应匹配 AltRight #225
Diagram Walkthrough
File Walkthrough
coordinator.rs
Fix LeftOption fallback to match AltLeft in window key matcheropenless-all/app/src-tauri/src/coordinator.rs
window_key_matches_triggerAltLeft; negative case nowrejects
AltRighthotkey.rs
Fix LeftOption virtual key mapping and add left/right Alt separationtestsopenless-all/app/src-tauri/src/hotkey.rs
VK_LMENUconstant (0xA4)trigger_to_vk_codemapping forLeftOptionfromVK_RMENUtoVK_LMENUwindows_optional_modifier_shortcuts_use_independent_latchestouse
VK_LMENUwindows_option_triggers_keep_left_and_right_alt_separateverifyingonly correct virtual keys trigger each option