aboutsummaryrefslogtreecommitdiffstats
path: root/keybinds/Binds.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-23 15:16:44 +0200
committerDanilo M. <danix@danix.xyz>2026-10-23 15:16:44 +0200
commita44c3ebc3eacffde9dc0ec932aa74dc7faa95eb2 (patch)
tree713c53cd874126a5a18c3e4048776655c4a10bb5 /keybinds/Binds.js
parent237e919e8807cd50856a493533b32cb0a06ae88c (diff)
downloadquickshell-a44c3ebc3eacffde9dc0ec932aa74dc7faa95eb2.tar.gz
quickshell-a44c3ebc3eacffde9dc0ec932aa74dc7faa95eb2.zip
keybinds: name the companion's code:49 bind
Hyprland 0.56.2 reports a Lua `code:N` bind with key "" and keycode 0 in `hyprctl binds -j`, while the bind itself works, so the reminder printed "Win + " with nothing after it. Such a bind is now named by its description, with "?" for one not listed, so a new keycode bind shows up as a visible gap rather than a blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'keybinds/Binds.js')
-rw-r--r--keybinds/Binds.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/keybinds/Binds.js b/keybinds/Binds.js
index 1f809cf..604a53d 100644
--- a/keybinds/Binds.js
+++ b/keybinds/Binds.js
@@ -42,8 +42,16 @@ const NAMES = Object.assign(Object.create(null), {
"XF86Search": "Fn+F11",
});
+// Hyprland 0.56.2 reports a Lua `code:N` bind with key "" and keycode 0, so
+// such a bind is named here by its description.
+// ponytail: one entry per keycode bind; a new `code:` bind needs a line here.
+const UNNAMED = Object.assign(Object.create(null), {
+ "Desktop: Companion": "\\", // code:49, left of 1
+});
+
function keys(bind) {
- return mods(bind.modmask).concat([NAMES[bind.key] ?? bind.key]).join(" + ");
+ const k = bind.key || UNNAMED[bind.description] || "?";
+ return mods(bind.modmask).concat([NAMES[k] ?? k]).join(" + ");
}
// Where a bind sits on the macropad, keyed by the combo as keys() writes it,