Cursor Position in Python

0 votes
How can I get the overall cursor position in Windows using the standard Python libraries?
Dec 11, 2018 in Python by ana1504.k
• 7,910 points
1,877 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 11, 2018 by SDeb
• 13,300 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, 2019 in Python by anonymous
9,792 views
+4 votes
4 answers
0 votes
1 answer

How to get the position of a character in Python?

There are two string methods for this, find() and index(). ...READ MORE

answered Jan 5 in Python by Gitika
• 65,970 points
138 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,890 points
15,693 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,479 views
0 votes
1 answer
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,300 points
1,260 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,300 points
233 views