mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
Update README.md
This commit is contained in:
parent
5b0631d48c
commit
f0984bdabc
18
README.md
18
README.md
@ -40,7 +40,7 @@ RobotGo supports Mac, Windows, and Linux(X11).
|
|||||||
|
|
||||||
## Requirements:
|
## Requirements:
|
||||||
|
|
||||||
Now, Please make sure Golang, GCC is installed correctly before installing RobotGo.
|
Now, Please make sure `Golang, GCC` is installed correctly before installing RobotGo.
|
||||||
|
|
||||||
### ALL:
|
### ALL:
|
||||||
```
|
```
|
||||||
@ -170,9 +170,9 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
x, y := robotgo.GetMousePos()
|
x, y := robotgo.GetMousePos()
|
||||||
fmt.Println("pos:", x, y)
|
fmt.Println("pos: ", x, y)
|
||||||
color := robotgo.GetPixelColor(100, 200)
|
color := robotgo.GetPixelColor(100, 200)
|
||||||
fmt.Println("color----", color)
|
fmt.Println("color---- ", color)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ func main() {
|
|||||||
fmt.Println("...", bitmap)
|
fmt.Println("...", bitmap)
|
||||||
|
|
||||||
fx, fy := robotgo.FindBitmap(bitmap)
|
fx, fy := robotgo.FindBitmap(bitmap)
|
||||||
fmt.Println("FindBitmap------", fx, fy)
|
fmt.Println("FindBitmap------ ", fx, fy)
|
||||||
|
|
||||||
robotgo.SaveBitmap(bitmap, "test.png")
|
robotgo.SaveBitmap(bitmap, "test.png")
|
||||||
}
|
}
|
||||||
@ -215,12 +215,12 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
keve := robotgo.AddEvent("k")
|
keve := robotgo.AddEvent("k")
|
||||||
if keve == 0 {
|
if keve == 0 {
|
||||||
fmt.Println("you press...", "k")
|
fmt.Println("you press... ", "k")
|
||||||
}
|
}
|
||||||
|
|
||||||
mleft := robotgo.AddEvent("mleft")
|
mleft := robotgo.AddEvent("mleft")
|
||||||
if mleft == 0 {
|
if mleft == 0 {
|
||||||
fmt.Println("you press...", "mouse left button")
|
fmt.Println("you press... ", "mouse left button")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -239,7 +239,7 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
fpid, err := robotgo.FindIds("Google")
|
fpid, err := robotgo.FindIds("Google")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fmt.Println("pids...", fpid)
|
fmt.Println("pids... ", fpid)
|
||||||
|
|
||||||
if len(fpid) > 0 {
|
if len(fpid) > 0 {
|
||||||
robotgo.ActivePID(fpid[0])
|
robotgo.ActivePID(fpid[0])
|
||||||
@ -259,11 +259,11 @@ func main() {
|
|||||||
|
|
||||||
abool := robotgo.ShowAlert("test", "robotgo")
|
abool := robotgo.ShowAlert("test", "robotgo")
|
||||||
if abool == 0 {
|
if abool == 0 {
|
||||||
fmt.Println("ok@@@", "ok")
|
fmt.Println("ok@@@ ", "ok")
|
||||||
}
|
}
|
||||||
|
|
||||||
title := robotgo.GetTitle()
|
title := robotgo.GetTitle()
|
||||||
fmt.Println("title@@@", title)
|
fmt.Println("title@@@ ", title)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
12
README_zh.md
12
README_zh.md
@ -37,7 +37,7 @@ QQ 群: 595877611
|
|||||||
## Requirements:
|
## Requirements:
|
||||||
环境要求:
|
环境要求:
|
||||||
|
|
||||||
在安装 RobotGo 之前, 请确保 Golang、GCC 被正确安装
|
在安装 RobotGo 之前, 请确保 `Golang、GCC` 被正确安装
|
||||||
|
|
||||||
### ALL:
|
### ALL:
|
||||||
```
|
```
|
||||||
@ -167,7 +167,7 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
x, y := robotgo.GetMousePos()
|
x, y := robotgo.GetMousePos()
|
||||||
fmt.Println("pos:", x, y)
|
fmt.Println("pos: ", x, y)
|
||||||
color := robotgo.GetPixelColor(100, 200)
|
color := robotgo.GetPixelColor(100, 200)
|
||||||
fmt.Println("color----", color)
|
fmt.Println("color----", color)
|
||||||
}
|
}
|
||||||
@ -211,12 +211,12 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
keve := robotgo.AddEvent("k")
|
keve := robotgo.AddEvent("k")
|
||||||
if keve == 0 {
|
if keve == 0 {
|
||||||
fmt.Println("you press...", "k")
|
fmt.Println("you press... ", "k")
|
||||||
}
|
}
|
||||||
|
|
||||||
mleft := robotgo.AddEvent("mleft")
|
mleft := robotgo.AddEvent("mleft")
|
||||||
if mleft == 0 {
|
if mleft == 0 {
|
||||||
fmt.Println("you press...", "mouse left button")
|
fmt.Println("you press... ", "mouse left button")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -254,11 +254,11 @@ func main() {
|
|||||||
|
|
||||||
abool := robotgo.ShowAlert("test", "robotgo")
|
abool := robotgo.ShowAlert("test", "robotgo")
|
||||||
if abool == 0 {
|
if abool == 0 {
|
||||||
fmt.Println("ok@@@", "ok")
|
fmt.Println("ok@@@ ", "ok")
|
||||||
}
|
}
|
||||||
|
|
||||||
title := robotgo.GetTitle()
|
title := robotgo.GetTitle()
|
||||||
fmt.Println("title@@@", title)
|
fmt.Println("title@@@ ", title)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user