mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
Update examples and README.md
This commit is contained in:
parent
b9cb452594
commit
f8539139b7
@ -17,9 +17,10 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
robotgo.ScrollMouse(10, "up")
|
||||
// robotgo.ScrollMouse(10, "up")
|
||||
robotgo.Scroll(0, 10)
|
||||
robotgo.MouseClick("left", true)
|
||||
robotgo.MoveMouseSmooth(100, 200, 1.0, 100.0)
|
||||
robotgo.MoveSmooth(100, 200, 1.0, 100.0)
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -46,7 +46,7 @@ func test() {
|
||||
fx, fy := robotgo.FindBitmap(bit2)
|
||||
fmt.Println("FindBitmap------ ", fx, fy)
|
||||
|
||||
arr := robotgo.FindEveryBitmap(bit2)
|
||||
arr := robotgo.FindAllBitmap(bit2)
|
||||
fmt.Println("Find every bitmap: ", arr)
|
||||
robotgo.SaveBitmap(bitmap, "test.png")
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ func findColor(bmp robotgo.CBitmap) {
|
||||
cnt1 := robotgo.CountColorCS(0xAADCDC, 10, 20, 30, 40)
|
||||
fmt.Println("count...", cnt1)
|
||||
|
||||
arr := robotgo.FindEveryColor(0xAADCDC)
|
||||
arr := robotgo.FindAllColor(0xAADCDC)
|
||||
fmt.Println("find all color: ", arr)
|
||||
for i := 0; i < len(arr); i++ {
|
||||
fmt.Println("pos is: ", arr[i].X, arr[i].Y)
|
||||
@ -160,7 +160,7 @@ func findBitmap(bmp robotgo.CBitmap) {
|
||||
fx, fy = robotgo.FindPic("test.tif")
|
||||
fmt.Println("FindPic------", fx, fy)
|
||||
|
||||
arr := robotgo.FindEveryBitmap(openbit)
|
||||
arr := robotgo.FindAllBitmap(openbit)
|
||||
fmt.Println("find all bitmap: ", arr)
|
||||
for i := 0; i < len(arr); i++ {
|
||||
fmt.Println("pos is: ", arr[i].X, arr[i].Y)
|
||||
|
@ -33,7 +33,7 @@ func move() {
|
||||
|
||||
// smooth move the mouse to 100, 200
|
||||
robotgo.MoveSmooth(100, 200)
|
||||
robotgo.MoveMouseSmooth(100, 200, 1.0, 100.0)
|
||||
robotgo.MoveSmooth(100, 200, 1.0, 100.0)
|
||||
robotgo.MoveSmoothRelative(10, -100, 1.0, 30.0)
|
||||
|
||||
for i := 0; i < 1080; i += 1000 {
|
||||
@ -68,13 +68,13 @@ func get() {
|
||||
|
||||
func toggleAndScroll() {
|
||||
// scrolls the mouse either up
|
||||
robotgo.ScrollMouse(10, "up")
|
||||
robotgo.Scroll(100, 200)
|
||||
// robotgo.ScrollMouse(10, "up")
|
||||
robotgo.Scroll(100, 10)
|
||||
robotgo.Scroll(0, -10)
|
||||
|
||||
// toggles right mouse button
|
||||
robotgo.MouseToggle("down", "right")
|
||||
|
||||
robotgo.MouseToggle("up")
|
||||
// toggles the right mouse button
|
||||
robotgo.Toggle("right")
|
||||
robotgo.Toggle("right", "up")
|
||||
}
|
||||
|
||||
func mouse() {
|
||||
|
@ -26,14 +26,14 @@ func aRobotgo() {
|
||||
x, y := robotgo.GetMousePos()
|
||||
fmt.Println("pos:", x, y)
|
||||
|
||||
robotgo.MoveMouse(x, y)
|
||||
robotgo.MoveMouse(100, 200)
|
||||
robotgo.Move(x, y)
|
||||
robotgo.Move(100, 200)
|
||||
|
||||
robotgo.MouseToggle("up")
|
||||
|
||||
for i := 0; i < 1080; i += 1000 {
|
||||
fmt.Println(i)
|
||||
robotgo.MoveMouse(800, i)
|
||||
robotgo.Move(800, i)
|
||||
}
|
||||
|
||||
fmt.Println(robotgo.GetPixelColor(x, y))
|
||||
@ -65,7 +65,7 @@ func aRobotgo() {
|
||||
fmt.Println("...type", reflect.TypeOf(bitTest), reflect.TypeOf(bitmapTest))
|
||||
|
||||
// robotgo.MouseClick()
|
||||
robotgo.ScrollMouse(10, "up")
|
||||
robotgo.Scroll(0, 10)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
Loading…
Reference in New Issue
Block a user