mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
1.3 KiB
1.3 KiB
#Robotgo
Golang 跨平台自动系统,控制键盘鼠标和读取屏幕
RobotGo 支持 Mac, Windows, and Linux(X11).
这是一项正在完善中的工作.
提Issues请到Github,便于统一管理和即时更新
##中文文档 API Document 英文文档请点击API Document.
##安装: go get github.com/go-vgo/robotgo
It's that easy!
###环境要求:
####ALL:
Golang
//Gcc
####For Mac OS X:
Xcode Command Line Tools
####For Windows:
MinGW or other GCC
####For everything else(Linux等其他系统): GCC
X11 with the XTest extension (also known as the Xtst library)
##例子:
###鼠标
package main
import (
//. "fmt"
"github.com/go-vgo/robotgo"
)
func main() {
robotgo.ScrollMouse(10, "up")
}
###键盘
package main
import (
//. "fmt"
"github.com/go-vgo/robotgo"
)
func main() {
robotgo.TypeString("Hello World")
robotgo.KeyTap("enter")
robotgo.TypeString("en")
}
###屏幕
package main
import (
. "fmt"
"github.com/go-vgo/robotgo"
)
func main() {
x, y := robotgo.GetMousePos()
Println("pos:", x, y)
}