diff --git a/mouse/goMouse.h b/mouse/goMouse.h index 67a3021..afba2d1 100644 --- a/mouse/goMouse.h +++ b/mouse/goMouse.h @@ -9,7 +9,7 @@ // except according to those terms. #include "../base/types.h" -#include "mouse_init.h" +#include "mouse_c.h" //Global delays. int mouseDelay = 10; diff --git a/mouse/mouse_init.h b/mouse/mouse_c.h similarity index 100% rename from mouse/mouse_init.h rename to mouse/mouse_c.h diff --git a/robotgo.go b/robotgo.go index 71d8a07..f811587 100644 --- a/robotgo.go +++ b/robotgo.go @@ -172,7 +172,16 @@ func MouseClick(args ...interface{}) { var button C.MMMouseButton var double C.bool Try(func() { - button = args[0].(C.MMMouseButton) + // button = args[0].(C.MMMouseButton) + if args[0].(string) == "left" { + button = C.LEFT_BUTTON + } + if args[0].(string) == "center" { + button = C.CENTER_BUTTON + } + if args[0].(string) == "right" { + button = C.RIGHT_BUTTON + } double = C.bool(args[1].(bool)) }, func(e interface{}) { // Println("err:::", e)