From ca4c34ec21b34fe82eea008bdc9e82553c1677d2 Mon Sep 17 00:00:00 2001 From: vCaesar Date: Sun, 2 Jul 2017 12:18:41 +0800 Subject: [PATCH] Update examples --- examples/main.go | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/examples/main.go b/examples/main.go index 533bdc8..56b4c6c 100644 --- a/examples/main.go +++ b/examples/main.go @@ -17,7 +17,7 @@ import ( // "go-vgo/robotgo" ) -func main() { +func key() { //////////////////////////////////////////////////////////////////////////////// // Control the keyboard //////////////////////////////////////////////////////////////////////////////// @@ -57,7 +57,9 @@ func main() { if err == nil { fmt.Println(text) } +} +func mouse() { //////////////////////////////////////////////////////////////////////////////// // Control the mouse //////////////////////////////////////////////////////////////////////////////// @@ -97,6 +99,9 @@ func main() { robotgo.MoveMouse(800, i) } +} + +func screen() { //////////////////////////////////////////////////////////////////////////////// // Read the screen //////////////////////////////////////////////////////////////////////////////// @@ -117,6 +122,9 @@ func main() { color2 := robotgo.GetPixelColor(10, 20) fmt.Println("color---", color2) +} + +func bitmap() { //////////////////////////////////////////////////////////////////////////////// // Bitmap //////////////////////////////////////////////////////////////////////////////// @@ -154,7 +162,9 @@ func main() { // open image bitmap openbit := robotgo.OpenBitmap("test.tif") fmt.Println("openBitmap...", openbit) +} +func event() { //////////////////////////////////////////////////////////////////////////////// // Global event listener //////////////////////////////////////////////////////////////////////////////// @@ -191,7 +201,9 @@ func main() { // stop AddEvent // robotgo.StopEvent() +} +func window() { //////////////////////////////////////////////////////////////////////////////// // Window Handle //////////////////////////////////////////////////////////////////////////////// @@ -263,3 +275,12 @@ func main() { fmt.Println("process: ", ps) } } + +func main() { + key() + mouse() + screen() + bitmap() + event() + window() +}