This commit is contained in:
0m.ax 2025-07-20 16:21:52 +02:00
parent 552550676b
commit 8c169188d8

View file

@ -6,7 +6,9 @@ import sys
import libevdev
#from libevdev import ecodes
MULTICAST_TTL = 4
def send(sock,x,y):
def main(device_path, dest_ip, dest_port):
def send(sock,x,y):
packet = struct.pack('<HH', x,y)
@ -14,7 +16,6 @@ def send(sock,x,y):
sock.sendto(packet, (dest_ip, dest_port))
print(f"Sent {len(packet)} bytes.")
def main(device_path, dest_ip, dest_port):
"""
Reads absolute X and Y coordinates from an evdev device and sends them
over UDP to a specified address and port.