commit
f9840861d6
@ -0,0 +1 @@
|
|||||||
|
*.swp
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
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()
|
||||||
Loading…
Reference in new issue