summaryrefslogtreecommitdiffstats
path: root/keybinds/Binds.js
diff options
context:
space:
mode:
Diffstat (limited to 'keybinds/Binds.js')
-rw-r--r--keybinds/Binds.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/keybinds/Binds.js b/keybinds/Binds.js
index 697f3c9..2029f36 100644
--- a/keybinds/Binds.js
+++ b/keybinds/Binds.js
@@ -16,14 +16,34 @@
// Modmask bits, in the order they are written in keybindings.lua.
// ponytail: CAPS/MOD2/MOD3/MOD5 bits are not decoded and vanish from the
// combo; add them here if a bind ever uses one.
-const MODS = [[64, "SUPER"], [4, "CTRL"], [8, "ALT"], [1, "SHIFT"]];
+// SUPER shows as Win, the key it is on.
+const MODS = [[64, "Win"], [4, "CTRL"], [8, "ALT"], [1, "SHIFT"]];
function mods(mask) {
return MODS.filter(m => mask & m[0]).map(m => m[1]);
}
+// Display names for keys whose Hyprland name is hard to remember. A key not
+// listed shows as Hyprland names it. The Fn combos are where the XF86 keys
+// sit on this keyboard, which is how they are pressed.
+const NAMES = Object.assign(Object.create(null), {
+ "mouse:272": "LMB",
+ "mouse:273": "RMB",
+ "mouse_up": "Mouse wheel up",
+ "mouse_down": "Mouse wheel down",
+ "XF86AudioRaiseVolume": "Volume +",
+ "XF86AudioLowerVolume": "Volume -",
+ "XF86AudioMute": "Mute",
+ "XF86AudioPlay": "Play/Pause",
+ "XF86AudioPrev": "Previous song",
+ "XF86AudioNext": "Next song",
+ "XF86Calculator": "Fn+F9",
+ "XF86Mail": "Fn+F10",
+ "XF86Search": "Fn+F11",
+});
+
function keys(bind) {
- return mods(bind.modmask).concat([bind.key]).join(" + ");
+ return mods(bind.modmask).concat([NAMES[bind.key] ?? bind.key]).join(" + ");
}
// A description reads "Group: Label". A bind without one still shows, last,