mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-23 17:59:12 +00:00
Update examples
This commit is contained in:
parent
2c870bb7a0
commit
ca4c34ec21
1 changed files with 22 additions and 1 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue