Python Forum

Full Version: How to get mouse coordinates on click and release
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everybody, I need to find a way to get the corners coordinates of the rectangle it's formed when selecting part of the screen. In other words:
1) I click (get coordinates)
2) I move the mouse
3) I release (get coordinates)

The second thing: how do I tell the program to treat the click&drag as a "select area" instead of "highlight text"?

I don't even know what library I should use Think
for listening for mouse events - check pynput package
here is the relevant part of the docs - https://pynput.readthedocs.io/en/latest/...-the-mouse

I am not sure what you mean in the second part of the question