Cursor Position in Python

0 votes
How can I get the overall cursor position in Windows using the standard Python libraries?
Dec 10, 2018 in Python by ana1504.k
• 7,870 points
170 views

1 answer to this question.

0 votes
You can use the following to retrieve the cursor's position, in screen coordinates - point = (x,y)

win32gui.GetCursorPos(point)
 

flags, hcursor, (x,y) = win32gui.GetCursorInfo()
Retrieves information about the global cursor.
answered Dec 10, 2018 by SDeb
• 13,180 points

Related Questions In Python

0 votes
2 answers

Python Error "UnicodeEncodeError: 'ascii' codec can't encode character u'\u03b1' in position 20: ordinal not in range(128)"

import csv import sys reload(sys) sys.setdefaultencoding('utf8') data = [["a", "b", u'\xe9']] with ...READ MORE

answered Jun 28 in Python by anonymous
701 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,810 points
195 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,420 points
116 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 331 views
0 votes
1 answer

Indentation of Python in Notepad++

To indent the block, select the entire ...READ MORE

answered Sep 18, 2018 in Python by SDeb
• 13,180 points
299 views
0 votes
1 answer

Print C format in Python

For printf- style formatting and special case ...READ MORE

answered Sep 18, 2018 in Python by SDeb
• 13,180 points
43 views