diff --git a/config/hypr/input.lua b/config/hypr/input.lua index 9591c0dd..d20be92a 100644 --- a/config/hypr/input.lua +++ b/config/hypr/input.lua @@ -7,7 +7,7 @@ -- input = { -- -- Use multiple keyboard layouts and switch between them with Left Alt + Right Alt. -- kb_layout = "us,dk,eu", --- kb_options = "compose:caps,shift:both_capslock,grp:alts_toggle", +-- kb_options = "compose:caps,shift:both_capslock_cancel,grp:alts_toggle", -- -- -- Use a specific keyboard variant if needed (e.g. intl for international keyboards). -- kb_variant = "intl", diff --git a/default/hypr/input.lua b/default/hypr/input.lua index c3c7d43f..bdcd384f 100644 --- a/default/hypr/input.lua +++ b/default/hypr/input.lua @@ -30,7 +30,11 @@ local vconsole = read_vconsole() local kb_layout = vconsole.XKBLAYOUT or "us" local kb_variant = vconsole.XKBVARIANT or "" -local kb_options = "compose:caps,shift:both_capslock" +-- CapsLock is the compose key, so Caps Lock itself has to live somewhere else. +-- Both Shifts together is the usual home for it, but it's easy to hit by +-- accident while typing. The _cancel variant sets Caps Lock the same way and +-- releases it on the next lone Shift, so a misfire clears itself. +local kb_options = "compose:caps,shift:both_capslock_cancel" -- Hyprland resolves keybindings against the first entry in kb_layout, not the -- layout that's currently active, so Omarchy's Latin-keysym bindings (SUPER + W diff --git a/test/shell.d/hyprland-keyboard-layout-test.sh b/test/shell.d/hyprland-keyboard-layout-test.sh index 68626cc8..8ed6fe38 100644 --- a/test/shell.d/hyprland-keyboard-layout-test.sh +++ b/test/shell.d/hyprland-keyboard-layout-test.sh @@ -55,7 +55,7 @@ assert_input() { pass "$description" } -base_options="compose:caps,shift:both_capslock" +base_options="compose:caps,shift:both_capslock_cancel" toggle_options="$base_options,grp:alts_toggle" assert_input "missing vconsole.conf falls back to us" "[us] [] [$base_options]"