mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
Update md
This commit is contained in:
parent
991c17a1b8
commit
680c0cbb9c
46
README.md
46
README.md
@ -111,3 +111,49 @@ func main() {
|
||||
Println("pos:", x, y)
|
||||
}
|
||||
```
|
||||
|
||||
###Bitmap
|
||||
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
. "fmt"
|
||||
|
||||
"github.com/go-vgo/robotgo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
bit_map := robotgo.CaptureScreen(10, 20, 30, 40)
|
||||
Println("...", bit_map)
|
||||
|
||||
fx, fy := robotgo.FindBitmap(bit_map)
|
||||
Println("FindBitmap------", fx, fy)
|
||||
|
||||
robotgo.SaveBitmap(bit_map, "test.png")
|
||||
}
|
||||
```
|
||||
|
||||
###Event
|
||||
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
. "fmt"
|
||||
|
||||
"github.com/go-vgo/robotgo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
keve := robotgo.LEvent("k")
|
||||
if keve == 0 {
|
||||
Println("you press...", "k")
|
||||
}
|
||||
|
||||
mleft := robotgo.LEvent("mleft")
|
||||
if mleft == 0 {
|
||||
Println("you press...", "mouse left button")
|
||||
}
|
||||
}
|
||||
```
|
46
README_zh.md
46
README_zh.md
@ -109,3 +109,49 @@ func main() {
|
||||
Println("pos:", x, y)
|
||||
}
|
||||
```
|
||||
|
||||
###位图
|
||||
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
. "fmt"
|
||||
|
||||
"github.com/go-vgo/robotgo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
bit_map := robotgo.CaptureScreen(10, 20, 30, 40)
|
||||
Println("...", bit_map)
|
||||
|
||||
fx, fy := robotgo.FindBitmap(bit_map)
|
||||
Println("FindBitmap------", fx, fy)
|
||||
|
||||
robotgo.SaveBitmap(bit_map, "test.png")
|
||||
}
|
||||
```
|
||||
|
||||
###事件
|
||||
|
||||
```Go
|
||||
package main
|
||||
|
||||
import (
|
||||
. "fmt"
|
||||
|
||||
"github.com/go-vgo/robotgo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
keve := robotgo.LEvent("k")
|
||||
if keve == 0 {
|
||||
Println("you press...", "k")
|
||||
}
|
||||
|
||||
mleft := robotgo.LEvent("mleft")
|
||||
if mleft == 0 {
|
||||
Println("you press...", "mouse left button")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user