You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
393 B

from pynput import mouse
from AppKit import NSScreen
def get_screen_size():
screen = NSScreen.mainScreen()
frame = screen.frame()
width = int(frame.size.width)
height = int(frame.size.height)
return width, height
def on_move(x, y):
w, h = get_screen_size()
print(128*x/w)
print(128*y/h)
with mouse.Listener(on_move=on_move) as listener:
listener.join()