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() +}