我可以在Python中跟踪整个屏幕上的鼠标指针吗?

Wel*_*ll3 3 python mouse tkinter

我希望鼠标悬停在整个屏幕上,而不仅限于我的GUI.

我曾经能够在C和MATLAB中完成它,但现在我在Python和Tkinter工作.

Wel*_*ll3 6

愚蠢的我 - 这很简单,你甚至不需要运行GUI.

import Tkinter as tk
root = tk.Tk()

root.winfo_pointerx()  # this returns the absolute mouse x co-ordinate.
Run Code Online (Sandbox Code Playgroud)