From 68798e24bc5c6aa98f147f78d7d45a105e59382e Mon Sep 17 00:00:00 2001 From: lordwelch Date: Mon, 6 Nov 2017 22:09:55 -0700 Subject: [PATCH] Debug --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f37fe96..82ea233 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ type Keys []Key type Args struct { SHORTCUT string `arg:"-S,help:Keymap cycle shortcut"` - ORDER []string `arg:positional,help:Order of keymaps` + ORDER []string `arg:"positional,help:Order of keymaps"` } const ( @@ -48,6 +48,7 @@ func Hold(press [8]byte, file io.Writer) { } func changeKeymap(r rune, keys map[string]Keys, args Args, hidg0 *os.File, currentKeyMap *int) { + fmt.Println(*currentKeyMap) for keys[args.ORDER[(*currentKeyMap)]][r].name != r { Press([8]byte{LCTRL, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00}, hidg0) *currentKeyMap++ @@ -64,7 +65,7 @@ func main() { err error keymapsF []os.FileInfo keys map[string]Keys - cfgPath = path.Join(os.Getenv("XDG_CONFIG_HOME"), "hid") + cfgPath = "./" //path.Join(os.Getenv("XDG_CONFIG_HOME"), "hid") stdin = bufio.NewReader(os.Stdin) currentKeyMap int )