Update examples

This commit is contained in:
vCaesar 2017-07-02 12:18:41 +08:00
parent 2c870bb7a0
commit ca4c34ec21

View File

@ -17,7 +17,7 @@ import (
// "go-vgo/robotgo" // "go-vgo/robotgo"
) )
func main() { func key() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Control the keyboard // Control the keyboard
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -57,7 +57,9 @@ func main() {
if err == nil { if err == nil {
fmt.Println(text) fmt.Println(text)
} }
}
func mouse() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Control the mouse // Control the mouse
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -97,6 +99,9 @@ func main() {
robotgo.MoveMouse(800, i) robotgo.MoveMouse(800, i)
} }
}
func screen() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Read the screen // Read the screen
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -117,6 +122,9 @@ func main() {
color2 := robotgo.GetPixelColor(10, 20) color2 := robotgo.GetPixelColor(10, 20)
fmt.Println("color---", color2) fmt.Println("color---", color2)
}
func bitmap() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Bitmap // Bitmap
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -154,7 +162,9 @@ func main() {
// open image bitmap // open image bitmap
openbit := robotgo.OpenBitmap("test.tif") openbit := robotgo.OpenBitmap("test.tif")
fmt.Println("openBitmap...", openbit) fmt.Println("openBitmap...", openbit)
}
func event() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Global event listener // Global event listener
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -191,7 +201,9 @@ func main() {
// stop AddEvent // stop AddEvent
// robotgo.StopEvent() // robotgo.StopEvent()
}
func window() {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Window Handle // Window Handle
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -263,3 +275,12 @@ func main() {
fmt.Println("process: ", ps) fmt.Println("process: ", ps)
} }
} }
func main() {
key()
mouse()
screen()
bitmap()
event()
window()
}