diff --git a/mouse/goMouse.h b/mouse/goMouse.h index af7e663..bbe9d72 100644 --- a/mouse/goMouse.h +++ b/mouse/goMouse.h @@ -60,10 +60,11 @@ int drag_mouse(int32_t x, int32_t y, MMMouseButton button){ return 0; } -bool move_mouse_smooth(size_t x, size_t y, double lowSpeed, +bool move_mouse_smooth(int32_t x, int32_t y, double lowSpeed, double highSpeed, int msDelay){ - MMPoint point; - point = MMPointMake(x, y); + MMPointInt32 point; + point = MMPointInt32Make(x, y); + bool cbool = smoothlyMoveMouse(point, lowSpeed, highSpeed); microsleep(msDelay); diff --git a/mouse/mouse.h b/mouse/mouse.h index 4438f2d..7dff62a 100644 --- a/mouse/mouse.h +++ b/mouse/mouse.h @@ -78,7 +78,7 @@ void dragMouse(MMPointInt32 point, const MMMouseButton button); * * Returns false if unsuccessful (i.e. a point was hit that is outside of the * screen boundaries), or true if successful. */ -bool smoothlyMoveMouse(MMPoint endPoint, double lowSpeed, double highSpeed); +bool smoothlyMoveMouse(MMPointInt32 endPoint, double lowSpeed, double highSpeed); // bool smoothlyMoveMouse(MMPoint point); /* Returns the coordinates of the mouse on the current screen. */ diff --git a/mouse/mouse_c.h b/mouse/mouse_c.h index 5e5194b..245f618 100644 --- a/mouse/mouse_c.h +++ b/mouse/mouse_c.h @@ -402,7 +402,7 @@ static double crude_hypot(double x, double y){ return ((M_SQRT2 - 1.0) * small) + big; } -bool smoothlyMoveMouse(MMPoint endPoint, double lowSpeed, double highSpeed){ +bool smoothlyMoveMouse(MMPointInt32 endPoint, double lowSpeed, double highSpeed){ MMPointInt32 pos = getMousePos(); MMSizeInt32 screenSize = getMainDisplaySize(); double velo_x = 0.0, velo_y = 0.0; @@ -432,7 +432,7 @@ bool smoothlyMoveMouse(MMPoint endPoint, double lowSpeed, double highSpeed){ return false; } - moveMouse(MMPointInt32Make((int32_t)pos.x, (int32_t)pos.y)); + moveMouse(pos); /* Wait 1 - 3 milliseconds. */ microsleep(DEADBEEF_UNIFORM(lowSpeed, highSpeed)); diff --git a/robotgo.go b/robotgo.go index 5089b90..c05fe55 100644 --- a/robotgo.go +++ b/robotgo.go @@ -401,8 +401,8 @@ func MoveMouseSmooth(x, y int, args ...interface{}) bool { // // robotgo.MoveSmooth(x, y int, low, high float64, mouseDelay int) func MoveSmooth(x, y int, args ...interface{}) bool { - cx := C.size_t(x) - cy := C.size_t(y) + cx := C.int32_t(x) + cy := C.int32_t(y) var ( mouseDelay = 10