diff --git a/pyautogui/_pyautogui_osx.py b/pyautogui/_pyautogui_osx.py index 1a895f0..8cd362c 100644 --- a/pyautogui/_pyautogui_osx.py +++ b/pyautogui/_pyautogui_osx.py @@ -444,5 +444,8 @@ def _dragTo(x, y, button): time.sleep(pyautogui.DARWIN_CATCH_UP_TIME) # needed to allow OS time to catch up. def _moveTo(x, y): + if (type(x) != int or type(y) != int): + raise Exception('The coordinates variable type must be int ') _sendMouseEvent(Quartz.kCGEventMouseMoved, x, y, 0) time.sleep(pyautogui.DARWIN_CATCH_UP_TIME) # needed to allow OS time to catch up. + diff --git a/pyautogui/_pyautogui_win.py b/pyautogui/_pyautogui_win.py index f4119ac..625f616 100644 --- a/pyautogui/_pyautogui_win.py +++ b/pyautogui/_pyautogui_win.py @@ -366,6 +366,8 @@ def _moveTo(x, y): Returns: None """ + if(type(x) != int or type(y) != int): + raise Exception('The coordinates variable type must be int ') ctypes.windll.user32.SetCursorPos(x, y) # This was a possible solution to issue #314 https://github.com/asweigart/pyautogui/issues/314 # but I'd like to hang on to SetCursorPos because mouse_event() has been superseded. @@ -571,3 +573,4 @@ def _vscroll(clicks, x, y): """ return _scroll(clicks, x, y) + diff --git a/pyautogui/_pyautogui_x11.py b/pyautogui/_pyautogui_x11.py index 38c8463..f34ee25 100644 --- a/pyautogui/_pyautogui_x11.py +++ b/pyautogui/_pyautogui_x11.py @@ -98,6 +98,8 @@ def _mouse_is_swapped(): def _moveTo(x, y): + if (type(x) != int or type(y) != int): + raise Exception('The coordinates variable type must be int ') fake_input(_display, X.MotionNotify, x=x, y=y) _display.sync()