Fix universal clipboard shortcuts under non-Latin keyboard layouts - #6419
Open
glafeara wants to merge 1 commit into
Open
Fix universal clipboard shortcuts under non-Latin keyboard layouts#6419glafeara wants to merge 1 commit into
glafeara wants to merge 1 commit into
Conversation
send_key_state resolves key names in the currently active keymap, so "V", "C", and "X" fail with "send_key_state: key not found" whenever a non-Latin layout (Russian, Ukrainian, Greek, ...) is active, and Super+V / Super+C / Super+X do nothing but show a runtime error notification. Physical keycodes resolve regardless of the active layout.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes universal clipboard shortcuts (Super+C/V/X) failing under non‑Latin keyboard layouts by avoiding layout-dependent key-name resolution in Hyprland’s send_key_state.
Changes:
- Switch injected clipboard letter keys from key names (
C/V/X) to layout-independent physical keycodes (code:54/code:55/code:53). - Add in-file documentation explaining why physical keycodes are required while
Insertremains name-based.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Problem
With a non-Latin keyboard layout active (Russian, Ukrainian, Greek, …), Super+V / Super+C / Super+X do nothing except pop a notification:
Root cause
send_key_stateresolves key names against the currently active keymap. While e.g. the Russian layout is active, the nameVhas no keysym in the keymap (that physical key produces Cyrillic М), so the lookup fails and the shortcut aborts.Insertstill resolves — special keys exist in every layout — which is why the terminal branch of universal paste keeps working while the Ctrl+V branch errors out.Reproducible directly:
Fix
Send the letter keys by physical keycode (
code:54/code:55/code:53for C/V/X), which resolves regardless of the active layout:Insertis left as a name since it is layout-independent already.Testing
Verified on an affected machine (Arch, omarchy quattro,
us,rulayouts): with the patched bindings, universal copy/paste/cut work in both layouts, in terminals and regular windows; no more runtime error notifications.test/shellpasses (except the pre-existingomarchy-pkgs checkoutenvironment check, which is unrelated).