diff --git a/bitmap/goBitmap.h b/bitmap/goBitmap.h index 5b3b4ec..a9438de 100644 --- a/bitmap/goBitmap.h +++ b/bitmap/goBitmap.h @@ -97,25 +97,6 @@ int count_of_bitmap(MMBitmapRef bitmap, MMBitmapRef sbit, float tolerance){ return countOfBitmapInRect(bitmap, sbit, rect, tolerance); } -MMPoint aFindBitmap(MMBitmapRef bit_map, MMRect rect){ - // MMRect rect; - // rect.size.width = 10; - // rect.size.height = 20; - // rect.origin.x = 10; - // rect.origin.y = 20; - - float tolerance = 0.0f; - MMPoint point; - - tolerance = 0.5; - - if (findBitmapInRect(bit_map, bit_map, &point, - rect, tolerance) == 0) { - return point; - } - return point; -} - bool point_in_bounds(MMBitmapRef bitmap, MMPoint point){ if (!bitmap_ready(bitmap)) { return NULL; diff --git a/robotgo.go b/robotgo.go index 769e6ab..065561e 100644 --- a/robotgo.go +++ b/robotgo.go @@ -542,12 +542,11 @@ func KeyTap(tapKey string, args ...interface{}) { } } else { - // fmt.Println("err:::", e) akey = "null" keyArr = []string{"null"} } - // }() + // zkey := C.CString(args[0]) zkey := C.CString(tapKey) defer C.free(unsafe.Pointer(zkey)) @@ -558,7 +557,6 @@ func KeyTap(tapKey string, args ...interface{}) { return } - // zkey := C.CString(args[0]) amod := C.CString(akey) amodt := C.CString(keyT) @@ -935,30 +933,6 @@ func CountBitmap(bitmap, sbit C.MMBitmapRef, args ...float32) int { return int(count) } -// FindBit find the bitmap, Wno-deprecated -func FindBit(args ...interface{}) (int, int) { - var bit C.MMBitmapRef - bit = args[0].(C.MMBitmapRef) - - var rect C.MMRect - Try(func() { - rect.origin.x = C.size_t(args[1].(int)) - rect.origin.y = C.size_t(args[2].(int)) - rect.size.width = C.size_t(args[3].(int)) - rect.size.height = C.size_t(args[4].(int)) - }, func(e interface{}) { - // fmt.Println("err:::", e) - // rect.origin.x = x - // rect.origin.y = y - // rect.size.width = w - // rect.size.height = h - }) - - pos := C.aFindBitmap(bit, rect) - // fmt.Println("pos----", pos) - return int(pos.x), int(pos.y) -} - // BitmapClick find the bitmap and click func BitmapClick(bitmap C.MMBitmapRef, args ...interface{}) { x, y := FindBitmap(bitmap)