Conversation
macOS's Lock Screen shortcut (Ctrl+Cmd+Q) is matched by the resolved character, not the physical key position the way Screenshot's Cmd+Shift+3 is. Hardcoding kVK_ANSI_Q for it types the character at that physical position on the active layout, which is 'A' on AZERTY, so the shortcut never fires. Fixes AprilNEA#1430
|
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.
Summary
Changes
crates/openlogi-inject/src/inject/macos.rs: macOS's Lock Screen shortcut (Ctrl+Cmd+Q) is matched by the resolved character, not the physical key position — confirmed by the reporter's own CGEventTap trace: posting the ANSI-QWERTY position of Q (kVK_ANSI_Q= 0x0C) typesAon AZERTY and does nothing, while posting the ANSI-QWERTY position of A (kVK_ANSI_A= 0x00, which typesQon AZERTY) successfully locks. This is unlike Screenshot's Cmd+Shift+3, which macOS binds to the physical digit-row position regardless of layout. Addedpost_key_for_char, which sets the event's unicode payload directly viaCGEventKeyboardSetUnicodeString(the same technique already used bypost_unicodeforTypeText) instead of relying on a fixed virtual keycode, and switchedNativeAction::LockScreento it.Testing
cargo check -p openlogi-inject --target x86_64-apple-darwincargo clippy -p openlogi-inject --target x86_64-apple-darwin --all-targets -- -D warningscargo clippy --workspace --all-targets -- -D warnings(full tier; Linux host, macOS code only cross-checked above)cargo test --workspaceRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items --exclude openlogi-ui --exclude openlogi-desktop --exclude openlogi-overlay --exclude openlogi-agentFixes #1430