From d6cdec99e0e0acc92fc8f01ad48472ab49e971dc Mon Sep 17 00:00:00 2001 From: Andrej Benz Date: Sun, 22 Dec 2024 19:03:18 +0100 Subject: [PATCH] keybinds: fix faulty validation messages --- cmd/version.txt | 2 +- internal/ui/keybinds.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/version.txt b/cmd/version.txt index 792768a..af88ba8 100644 --- a/cmd/version.txt +++ b/cmd/version.txt @@ -1 +1 @@ -0.11.1-git +0.11.1 diff --git a/internal/ui/keybinds.go b/internal/ui/keybinds.go index c0d2ec4..e3f87b0 100644 --- a/internal/ui/keybinds.go +++ b/internal/ui/keybinds.go @@ -164,10 +164,10 @@ func (keybinds) validate(bind string) { for _, v := range fields { if len(v) > 1 { - _, exists := modifiers[v] - _, exists = specialKeys[v] + _, existsMod := modifiers[v] + _, existsSpecial := specialKeys[v] - if !exists { + if !existsMod && !existsSpecial { slog.Error("invalid keybind", bind, "key", v) } } @@ -178,7 +178,7 @@ func (keybinds) validateTriggerLabels(bind string) { fields := strings.Fields(bind) _, exists := modifiersInt[fields[0]] - if !exists || len(fields[0]) != 1 { + if !exists || len(fields[0]) == 1 { slog.Error("invalid trigger_label keybind", bind) } }