From 57db5a7202f2b04ee9339bda7bf8fa728d1af726 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Mon, 22 Apr 2019 14:00:36 -0400 Subject: [PATCH] Fixed #213 AddEvents() can't listen correctly multiple times --- robotgo.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/robotgo.go b/robotgo.go index 971a05d..4cc59f6 100644 --- a/robotgo.go +++ b/robotgo.go @@ -1327,8 +1327,10 @@ func AddEvents(key string, arr ...string) bool { } if e.Kind == hook.KeyUp && e.Keycode == ukey { - k-- - time.Sleep(10 * time.Microsecond) + if k > 0 { + k-- + } + // time.Sleep(10 * time.Microsecond) ct = false } }