Skip to content
Steve Paget edited this page Feb 16, 2016 · 3 revisions

Returns the x position of the mouse


Syntax:

mouseX()

Returns an integer value representing the position of the mouse, in pixels, from the left edge of the window.

eg.

print( mouseX() )


Troubleshooting

It has been noted that mouse coordinates are sometimes reported incorrectly if the user is running Python in a virtual environment (such as VMWare). If you find this, you should adjust your VM settings to ensure the mouse is captured correctly.

Clone this wiki locally