Skip to content

fix(hypr): send universal clipboard chords by keycode - #13007

Open
kvnloo wants to merge 1 commit into
omacom:quattrofrom
kvnloo:tip/12570-clipboard-keycodes
Open

kvnloo wants to merge 1 commit into
omacom:quattrofrom
kvnloo:tip/12570-clipboard-keycodes

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 23, 2026

Copy link
Copy Markdown

Summary

Universal copy/paste/cut/select-all (SUPER+C/V/X/A) synthesize Ctrl chords with send_key_state using letter keysym names. When the active XKB layout is non-Latin (e.g. Russian), those keysyms are absent from the keymap, Hyprland reports key not found, and the shortcut does nothing.

Send the physical XKB keycodes (code:38/53/54/55 for A/X/C/V) instead so the injected chords stay layout-independent. Terminal still gets Ctrl+Shift+C/V on the same physical keys.

Why still needed

Still broken on current quattro. Prior attempts (#9130, #7283, and several closed duplicates) are CONFLICTING/DIRTY against quattro, so this is a fresh minimal tip.

Test plan

  • bash test/shell.d/hyprland-default-config-test.sh
  • With kb_layout = us,ru and Russian active: SUPER+V pastes, SUPER+C copies (no Hyprland "key not found" toast)
  • With US active: same shortcuts still work in normal apps and in the terminal (Ctrl+Shift+C/V)

Fixes #12570

SUPER+C/V/X/A inject Ctrl chords via send_key_state using letter keysyms.
On a non-Latin active layout those keysyms are missing, so Hyprland errors
with "key not found" and paste/copy/cut/select-all do nothing. Send the
physical XKB keycodes instead so the chords stay layout-independent.

Fixes omacom#12570
@llstrk

llstrk commented Sep 23, 2026

Copy link
Copy Markdown

One source-supported regression: fixed QWERTY positions change the injected shortcut on other Latin layouts.

Preserve logical letters on non-QWERTY layouts

The new keycode constants bypass keysym lookup, but a physical keycode does not preserve the letter across layouts. With a single Dvorak layout (kb_layout = "us", kb_variant = "dvorak"), code 54 is J, not C. French AZERTY similarly puts Q at code 38.

Source-traced normal-application chords, not observed application behavior:

Layout / action Before This PR
Dvorak: copy Ctrl+C Ctrl+J
Dvorak: paste Ctrl+V Ctrl+K
Dvorak: cut Ctrl+X Ctrl+Q
French AZERTY: select all Ctrl+A Ctrl+Q

Hyprland 0.56.2 accepts code:N directly, whereas the previous letter names resolve to the correct positions in these single-layout configurations. The terminal branch retains Shift, so Dvorak copy/paste instead become Ctrl+Shift+J/K there.

Impact: these shortcuts can invoke unrelated actions or do nothing instead of copy/paste/cut/select-all. Ctrl+Q can quit applications that bind it; individual client reactions were not tested.

Suggested change: preserve logical letter selection on non-QWERTY layouts. Make the non-Latin fallback aware of the layout used for the injected event, rather than applying US physical positions globally.

Verified: source inspection confirms that code:N bypasses the lookup responsible for key not found. Terminal detection, modifier selection and the existing down/up timer are unchanged. This does not establish end-to-end copy/paste success with Russian active.


Review information

Test scope: conclusions are supported by pinned Omarchy/Hyprland source and XKB layout definitions. No compositor or application-level clipboard testing; proposed corrections are untested.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra Medium initial inspection and synthesis, independent Opus 5.5 High and GPT 6 Sol Xhigh technical reviews, and a fresh Astra Medium editorial check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Universal paste (SUPER+V) fails with 'key not found' when active keyboard layout lacks the Latin key symbol (e.g. Russian layout)

2 participants