From 10f23931235d9f2004ba04d86ef52069b1093290 Mon Sep 17 00:00:00 2001 From: T4O2M0 <41974915+T4O2M0@users.noreply.github.com> Date: Wed, 2 Sep 2020 22:50:42 -0700 Subject: [PATCH] Fixed Mouse buttons reversed left and right click were swapped so I changed that --- examples/gohook/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gohook/main.go b/examples/gohook/main.go index 31300b7..38479aa 100644 --- a/examples/gohook/main.go +++ b/examples/gohook/main.go @@ -36,9 +36,9 @@ func addEvent() { func addMouse() { fmt.Println("--- Please press left mouse button to see it's position and the right mouse button to exit ---") robotgo.EventHook(hook.MouseDown, []string{}, func(e hook.Event) { - if e.Button == hook.MouseMap["right"] { + if e.Button == hook.MouseMap["left"] { fmt.Printf("mleft @ %v - %v\n", e.X, e.Y) - } else if e.Button == hook.MouseMap["left"] { + } else if e.Button == hook.MouseMap["right"] { robotgo.EventEnd() } })