From e0ac006ff1d21776c5a43b19f913c251deaf4245 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Fri, 8 Mar 2019 10:09:16 -0400 Subject: [PATCH] add addMouse examples code --- examples/event/main.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/examples/event/main.go b/examples/event/main.go index 402ee10..93069a7 100644 --- a/examples/event/main.go +++ b/examples/event/main.go @@ -40,6 +40,20 @@ func addEvent() { } } +func addMouse() { + fmt.Println("--- Please press left mouse button ---") + ok := robotgo.AddMouse("left") + if ok { + fmt.Println("add mouse...") + } + + fmt.Println("--- Please press left mouse button and move mosue to 100,100 ---") + ok = robotgo.AddMouse("left", 100, 100) + if ok { + fmt.Println("add mouse and move to 100,100 ...") + } +} + func add() { fmt.Println("--- Please press v---") eve := robotgo.AddEvent("v") @@ -88,5 +102,7 @@ func main() { addEvent() + addMouse() + event() }