我在这个函数中编写了一个脚本,我需要它来读取某个文本框的鼠标位置。我希望脚本在读取鼠标位置并将其分配给变量之前停止,并在单击鼠标时继续执行。(mousePosRead)) l = tk.Label(main, text='position was read and saved.').pack()
我试过pynputb) Python会因为监听器和tkinter同时运行而生气(一些关于线程的事情)。
from pynput.keyboard import Key, Controller as KeyboardControllerfrom pynput.keyboard import Key, Listener
mouseevents until released on_press=on_press) a