mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
31 lines
497 B
Go
31 lines
497 B
Go
package main
|
|
|
|
import (
|
|
. "fmt"
|
|
|
|
"github.com/go-vgo/robotgo"
|
|
)
|
|
|
|
func arobotgo() {
|
|
x, y := robotgo.GetMousePos()
|
|
Println("pos:", x, y)
|
|
|
|
Println(robotgo.GetPixelColor(x, y))
|
|
|
|
color := robotgo.GetPixelColor(100, 200)
|
|
Println("color@@@", color)
|
|
|
|
robotgo.TypeString("Hello World")
|
|
robotgo.KeyTap("f1", "control")
|
|
// robotgo.KeyTap("enter")
|
|
// robotgo.KeyToggle("enter", "down")
|
|
robotgo.TypeString("en")
|
|
|
|
// robotgo.MouseClick()
|
|
robotgo.ScrollMouse(10, "up")
|
|
}
|
|
|
|
func main() {
|
|
arobotgo()
|
|
}
|