Skip to content

Commit dd65a1d

Browse files
committed
update examples remove duplicate code
1 parent 6ba20df commit dd65a1d

File tree

7 files changed

+42
-378
lines changed

7 files changed

+42
-378
lines changed

examples/bitmap/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
// "go-vgo/robotgo"
2020
)
2121

22-
func main() {
22+
func bitmap() {
2323
////////////////////////////////////////////////////////////////////////////////
2424
// Bitmap
2525
////////////////////////////////////////////////////////////////////////////////
@@ -69,6 +69,7 @@ func main() {
6969
fx, fy = robotgo.FindBitmap(bit)
7070
fmt.Println("FindBitmap------", fx, fy)
7171

72+
// bitmap := robotgo.CaptureScreen(10, 20, 30, 40)
7273
abool := robotgo.PointInBounds(bitmap, 1, 2)
7374
fmt.Println("point in bounds...", abool)
7475

@@ -117,3 +118,7 @@ func main() {
117118
// free the bitmap
118119
robotgo.FreeBitmap(abitMap)
119120
}
121+
122+
func main() {
123+
bitmap()
124+
}

examples/event/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// "go-vgo/robotgo"
1818
)
1919

20-
func main() {
20+
func event() {
2121
////////////////////////////////////////////////////////////////////////////////
2222
// Global event listener
2323
////////////////////////////////////////////////////////////////////////////////
@@ -55,3 +55,7 @@ func main() {
5555
// stop AddEvent
5656
// robotgo.StopEvent()
5757
}
58+
59+
func main() {
60+
event()
61+
}

examples/key/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// "go-vgo/robotgo"
1818
)
1919

20-
func main() {
20+
func key() {
2121
////////////////////////////////////////////////////////////////////////////////
2222
// Control the keyboard
2323
////////////////////////////////////////////////////////////////////////////////
@@ -72,3 +72,7 @@ func main() {
7272
fmt.Println(text)
7373
}
7474
}
75+
76+
func main() {
77+
key()
78+
}

0 commit comments

Comments
 (0)