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