From 29f30ad52bf6fd48b8d59473c197b94d0d0b011f Mon Sep 17 00:00:00 2001 From: John Gebbie Date: Tue, 12 Sep 2023 12:27:27 +0100 Subject: [PATCH] prefer keys without modifiers --- keys.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/keys.go b/keys.go index a91428f..eca9215 100644 --- a/keys.go +++ b/keys.go @@ -629,10 +629,15 @@ func initKeys(keymap *xkb.Keymap) { chord := newChord(keymap, keymap.KeyGetMod(code, 0, level), code) for name, s := range linuxXSyms { if s == sym { - LinuxKeys[name] = chord + if _, ok := LinuxKeys[name]; !ok { + LinuxKeys[name] = chord + } } } - XKeys[xkb.KeysymGetName(sym)] = chord + name := xkb.KeysymGetName(sym) + if _, ok := XKeys[name]; !ok { + XKeys[name] = chord + } } } }