initial commit

This commit is contained in:
2026-04-17 21:47:42 -04:00
commit e108338251
2 changed files with 50 additions and 0 deletions

25
pc.py Normal file
View File

@@ -0,0 +1,25 @@
import socket
from pynput.mouse import Controller
mouse = Controller()
HOST = '0.0.0.0'
PORT = 2025
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((HOST, PORT))
print(f"listening on {HOST}:{PORT}")
try:
while True:
data, addr = sock.recvfrom(1024)
x_str, y_str = data.decode().split(',')
x = float(x_str)
y = float(y_str)
mouse.position = (x, y)
print(f"Moved mouse to: X={x}, Y={y}")
except KeyboardInterrupt:
print("UDP server shutting down.")
finally:
sock.close()