Allow toggling Caps Lock via both Shift keys#5981
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the shift:both_capslock XKB option so that pressing both Shift keys simultaneously toggles Caps Lock, in addition to the existing compose:caps setting.
Changes:
- Append
shift:both_capslocktokb_optionsin the default Hyprland input config. - Append
shift:both_capslocktokb_optionsin the user Hyprland input config.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| default/hypr/input.lua | Adds both-shift Caps Lock toggle to default keyboard options. |
| config/hypr/input.lua | Adds the same option to the user-facing config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Also very much liked the Ctrl + Capslock option proposed in #2545 but as long as I can get back access to those cute uppercase accented characters we "like" in France 🙄 ... |
From looking around in the community it seemed double shift as an alternate was a bit more common, and I had heard some odd behavior of modifier keys with capslock can happen, thus went with double shift. Happy to switch the PR to ctrl + caps if there's a strong signal to go that direction though. |
Adds
shift:both_capslockalongside the existingcompose:capsindefault/hypr/input.luaandconfig/hypr/input.lua. Pressing both Shift keys simultaneously now toggles real Caps Lock; single-Shift behavior is unchanged, and Caps Lock continues to act as the XCompose key.Why
The current default
compose:capsmakes Caps Lock the XCompose key — great for emoji, accented characters, and~/.XComposeshortcuts — but it removes any way to enable real Caps Lock, which is occasionally valuable. More importantly, fcitx5's Wayland input-method grab occasionally desyncs (notably after a Hyprland reload), and when it does, Caps Lock can get stuck "on" with no easy way to toggle it back off — the Compose key is the very thing that's broken. This recurring confusion shows up across closed issues #166, #953, #1792, #2241, #2545, #3238, and #5200.shift:both_capslockis a stock libxkbcommon option that provides an escape hatch. It costs nothing for users who don't reach for it:This is purely additive — it restores the missing Caps Lock capability via a discoverable two-Shift chord without changing any existing behavior.
Note on syntax
The XKB option string is comma-separated and must not contain spaces between options.
"compose:caps,shift:both_capslock"is correct;"compose:caps, shift:both_capslock"would cause libxkbcommon to silently drop the second option. The change uses the correct space-free form.Test plan
~/.XComposeshortcuts still work.🤖 Generated with Claude Code