Skip to content

Fix universal clipboard shortcuts under non-Latin keyboard layouts - #6419

Open
glafeara wants to merge 1 commit into
basecamp:quattrofrom
glafeara:fix-clipboard-shortcuts-non-latin-layouts
Open

Fix universal clipboard shortcuts under non-Latin keyboard layouts#6419
glafeara wants to merge 1 commit into
basecamp:quattrofrom
glafeara:fix-clipboard-shortcuts-non-latin-layouts

Conversation

@glafeara

Copy link
Copy Markdown
Contributor

Problem

With a non-Latin keyboard layout active (Russian, Ukrainian, Greek, …), Super+V / Super+C / Super+X do nothing except pop a notification:

Runtime error in lua:
=[C]:-1: send_key_state: key not found

Root cause

send_key_state resolves key names against the currently active keymap. While e.g. the Russian layout is active, the name V has no keysym in the keymap (that physical key produces Cyrillic М), so the lookup fails and the shortcut aborts. Insert still 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:

$ hyprctl dispatch "hl.dsp.send_key_state({ mods = 'CTRL', key = 'V', state = 'up' })"
error: =[C]:-1: send_key_state: key not found        # Russian layout active
ok                                                   # US layout active

Fix

Send the letter keys by physical keycode (code:54/code:55/code:53 for C/V/X), which resolves regardless of the active layout:

$ hyprctl dispatch "hl.dsp.send_key_state({ mods = 'CTRL', key = 'code:55', state = 'up' })"
ok                                                   # Russian layout active

Insert is left as a name since it is layout-independent already.

Testing

Verified on an affected machine (Arch, omarchy quattro, us,ru layouts): with the patched bindings, universal copy/paste/cut work in both layouts, in terminals and regular windows; no more runtime error notifications. test/shell passes (except the pre-existing omarchy-pkgs checkout environment check, which is unrelated).

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.
Copilot AI review requested due to automatic review settings July 28, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Insert remains 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.

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.

2 participants