aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/configs/system_keybinds.lua
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmail.com>2026-08-05 07:28:34 -0400
committerPinapelz <yukais@pinapelz.com>2026-08-29 21:41:34 -0700
commit0911f2c77d6b2d42203f47da072437f32f1029f3 (patch)
tree45e541829017764d33fcf03e5c28c02d149e8f20 /config/hypr/configs/system_keybinds.lua
parentff8a39488f28343df98973817ce87351080a2063 (diff)
Fixed migrate script to handle SHIFT
Signed-off-by: Don Williams <don.e.williams@gmail.com>
Diffstat (limited to 'config/hypr/configs/system_keybinds.lua')
-rw-r--r--config/hypr/configs/system_keybinds.lua39
1 files changed, 37 insertions, 2 deletions
diff --git a/config/hypr/configs/system_keybinds.lua b/config/hypr/configs/system_keybinds.lua
index 79407eac..9e6e7ebd 100644
--- a/config/hypr/configs/system_keybinds.lua
+++ b/config/hypr/configs/system_keybinds.lua
@@ -49,8 +49,43 @@ local function trim(value)
return (value or ""):gsub("^%s+", ""):gsub("%s+$", "")
end
+local function normalize_mods(mods)
+ mods = trim(mods)
+ if mods == "" then
+ return ""
+ end
+ local known = {
+ super = "SUPER",
+ super_l = "SUPER_L",
+ super_r = "SUPER_R",
+ shift = "SHIFT",
+ shift_l = "SHIFT_L",
+ shift_r = "SHIFT_R",
+ ctrl = "CTRL",
+ control = "CTRL",
+ ctrl_l = "CTRL_L",
+ ctrl_r = "CTRL_R",
+ control_l = "CTRL_L",
+ control_r = "CTRL_R",
+ alt = "ALT",
+ alt_l = "ALT_L",
+ alt_r = "ALT_R",
+ meta = "META",
+ meta_l = "META_L",
+ meta_r = "META_R",
+ mod2 = "MOD2",
+ mod3 = "MOD3",
+ mod5 = "MOD5",
+ }
+ local parts = {}
+ for token in mods:gmatch("%S+") do
+ parts[#parts + 1] = known[token:lower()] or token
+ end
+ return table.concat(parts, " ")
+end
+
local function chord(mods, key)
- mods = trim(mods):gsub("%s+", " + ")
+ mods = normalize_mods(mods):gsub("%s+", " + ")
key = trim(key)
if mods == "" then
return key
@@ -92,7 +127,7 @@ local function key_variants(key, mods)
["code:18"] = "9",
["code:19"] = "0",
}
- if mods:match("SHIFT") and shifted_number_keys[key] then
+ if mods:upper():match("SHIFT") and shifted_number_keys[key] then
local number_key = number_keys[key]
if number_key then
return { shifted_number_keys[key], number_key }
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage