Repository navigation
Send clipboard shortcuts using physical XKB keys - #9130
yashranaway wants to merge 4 commits into
Conversation
|
This is very much needed. I hope the next PR review wave comes soon. For now the same can be achieved by pasting Into |
|
Your XKB keycodes were right; I've switched to 54/55/53, preserved the current terminal shortcuts, and covered the callbacks in a Lua test. |
|
Measurement from a live non-Latin session, separating this from #13007 (per @linyiru request in #12557). Environment: Hyprland 0.56.2, layouts us,ru,us, Omarchy 4.0.4-1. Our ru pack already runs the equivalent of this PR live (code:54/55 for copy/paste under a Cyrillic layout) — works, because the primary is QWERTY. The separator is a non-QWERTY primary. Via xkbcli (same XKB data Hyprland resolves against): | letter | QWERTY keycode (this PR) | us-dvorak keycode (#13007) | letter sitting at this PRs keycode on dvorak | So on a Dvorak primary this PR sends CTRL+J / CTRL+K / CTRL+Q (quit!) for copy/paste/cut, while #13007 resolves 31/60/56 correctly. Hardcoded QWERTY positions are only safe when the primary is QWERTY; the primary-layout resolution covers that case plus Dvorak/AZERTY. |
|
Reviewed against
Today both layouts work, because the named key resolves through the active layout. The Lua test cannot catch this, since it stubs #13007 fixes the same bug by resolving each letter against the configured primary layout with Nothing was run on a worker, since verifying a fix that is not the one being recommended would test nothing anyone is about to merge. The second opinion (Codex Medium) did not review this: it answered a ping, but its daily review allowance was already spent, so this rests on one model's reading. Waiting on the maintainer. |
|
Confirmed with compiled XKB maps: these physical keycodes send Ctrl+Q for AZERTY select-all and Dvorak cut. I'm closing this hardcoded approach; #13007 resolves shortcuts against the configured layout. |
Copy, paste, cut, and select all should keep working when the active keyboard layout has no Latin letters. This sends the physical keys while keeping the current terminal shortcuts. Fixes #8960.
<<<< AI wording below >>>>
Problem
Hyprland resolves synthetic key names such as
Cagainst the active layout. On non-Latin layouts,send_key_statecan reportkey not found. Thecode:form expects XKB keycodes, which differ from Linux evdev codes by eight.Fix
Use XKB keycodes 38, 54, 55, and 53 for A, C, V, and X. Keep the current
Ctrl+Shift+C/Vshortcuts for terminals andCtrl+C/Velsewhere.Verification
The default Hyprland config and binding-conflict tests pass in a container with Lua 5.4. A Lua test exercises the callback for each shortcut and checks the key, modifiers, and down/up events. Shell syntax and
git diff --checkpass. No live non-Latin keyboard session was available.