From 5230969381b23ae7e9a1c9e5a13925eadb26bcff Mon Sep 17 00:00:00 2001 From: John Gebbie Date: Mon, 6 Feb 2023 11:20:49 +0000 Subject: [PATCH] omit k: and x: in error messages --- dotool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dotool.go b/dotool.go index 7073c3c..2c337c4 100644 --- a/dotool.go +++ b/dotool.go @@ -108,7 +108,7 @@ func parseChord(chord string) (Chord, error) { if strings.HasPrefix(k, "k:") { code, err := strconv.Atoi(k[2:]) if err != nil { - return c, errors.New("invalid keycode: " + k) + return c, errors.New("invalid keycode: " + k[2:]) } c.Key = code } else if strings.HasPrefix(k, "x:") { @@ -120,7 +120,7 @@ func parseChord(chord string) (Chord, error) { } else if code, ok := xKeysNormal[strings.ToLower(k[2:])]; ok { c.Key = code } else { - return c, errors.New("unknown X11 key: " + k) + return c, errors.New("unknown X11 key: " + k[2:]) } } else { code, ok := linuxKeys[strings.ToLower(k)]