

This can be achieved by getting current position whenever timer event is fired.
#GET AND PRINT THE MOUSE COORDINATES FULL#
So the full code to execute this is shown below. And the second value is the y-coordinate of where the mouse cursor is. The first value is the x-coordinate of where the mouse cursor is. This function returns a tuple of the position of the mouse's cursor.

Drawing on paper and stuff but I guess I suck at explaining it. To determine the mouses current position, we use the statement, pyautogui.position(). I have a hard time explaining how easy the coorinate system is. You must set a global or instance variable if you want to access the values outside of the callback. Adding a mouse listener to the component and then displaying the value returned by MouseEvent#getXOnScreen() and MouseEvent#getYOnScreen() on mouse moved event. Me and my 13 year old son just started to learn programming in processing with the guidence from the coding train.The first problem is getting the mouse position, now there are two solutions to this problem:.
