mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
add bitmap click and movesClick func
This commit is contained in:
parent
50ce138395
commit
8733401ce5
14
robotgo.go
14
robotgo.go
@ -62,7 +62,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version string = "v0.47.0.477, Mount Cook!"
|
version string = "v0.47.0.481, Mount Cook!"
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@ -490,6 +490,12 @@ func MoveClick(x, y int, args ...interface{}) {
|
|||||||
MouseClick(args)
|
MouseClick(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MovesClick move smooth and click the mouse
|
||||||
|
func MovesClick(x, y int, args ...interface{}) {
|
||||||
|
MoveSmooth(x, y)
|
||||||
|
MouseClick(args)
|
||||||
|
}
|
||||||
|
|
||||||
// MouseToggle toggle the mouse
|
// MouseToggle toggle the mouse
|
||||||
func MouseToggle(args ...interface{}) {
|
func MouseToggle(args ...interface{}) {
|
||||||
var button C.MMMouseButton
|
var button C.MMMouseButton
|
||||||
@ -819,6 +825,12 @@ func FindBit(args ...interface{}) (int, int) {
|
|||||||
return int(pos.x), int(pos.y)
|
return int(pos.x), int(pos.y)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BitmapClick find the bitmap and click
|
||||||
|
func BitmapClick(bitmap C.MMBitmapRef, args ...interface{}) {
|
||||||
|
x, y := FindBitmap(bitmap)
|
||||||
|
MovesClick(x, y, args)
|
||||||
|
}
|
||||||
|
|
||||||
// PointInBounds bitmap point in bounds
|
// PointInBounds bitmap point in bounds
|
||||||
func PointInBounds(bitmap C.MMBitmapRef, x, y int) bool {
|
func PointInBounds(bitmap C.MMBitmapRef, x, y int) bool {
|
||||||
var point C.MMPoint
|
var point C.MMPoint
|
||||||
|
Loading…
Reference in New Issue
Block a user