aboutsummaryrefslogtreecommitdiffstats
path: root/keybinds/Binds.js
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-25 19:11:22 +0200
committerDanilo M. <danix@danix.xyz>2026-09-25 19:11:22 +0200
commit2cbc78d4fcc1f14bc9aba3d27e69a77fbde030a6 (patch)
tree612c3f4c34ba11dc98ea0f28b4d5b1d00c0054f7 /keybinds/Binds.js
parentea063fa984ef775950c840013462a49355576d0b (diff)
downloadquickshell-2cbc78d4fcc1f14bc9aba3d27e69a77fbde030a6.tar.gz
quickshell-2cbc78d4fcc1f14bc9aba3d27e69a77fbde030a6.zip
fix(keybinds): survive group names shadowing Object.prototype
A description like "toString: X" made byName["toString"] resolve to the inherited Object.prototype.toString instead of undefined, so the group was never created and .rows.push threw. Object.create(null) gives byName no prototype to shadow. Also note in a comment that CAPS/MOD2/MOD3/MOD5 modmask bits are not decoded and silently drop from the combo string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'keybinds/Binds.js')
-rw-r--r--keybinds/Binds.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/keybinds/Binds.js b/keybinds/Binds.js
index 5c0ce2d..697f3c9 100644
--- a/keybinds/Binds.js
+++ b/keybinds/Binds.js
@@ -14,6 +14,8 @@
// see test_binds.js.
// 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"]];
function mods(mask) {
@@ -28,7 +30,7 @@ function keys(bind) {
// so a gap in the config is visible rather than silently missing.
function group(binds) {
const groups = [];
- const byName = {};
+ const byName = Object.create(null);
const undescribed = [];
for (const b of binds) {
const d = b.description || "";