sample
This commit is contained in:
parent
552550676b
commit
8c169188d8
1 changed files with 6 additions and 5 deletions
11
main.py
11
main.py
|
@ -6,15 +6,16 @@ import sys
|
||||||
import libevdev
|
import libevdev
|
||||||
#from libevdev import ecodes
|
#from libevdev import ecodes
|
||||||
MULTICAST_TTL = 4
|
MULTICAST_TTL = 4
|
||||||
def send(sock,x,y):
|
def main(device_path, dest_ip, dest_port):
|
||||||
|
|
||||||
packet = struct.pack('<HH', x,y)
|
def send(sock,x,y):
|
||||||
|
|
||||||
|
packet = struct.pack('<HH', x,y)
|
||||||
|
|
||||||
# Send the packet over UDP
|
# Send the packet over UDP
|
||||||
sock.sendto(packet, (dest_ip, dest_port))
|
sock.sendto(packet, (dest_ip, dest_port))
|
||||||
print(f"Sent {len(packet)} bytes.")
|
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
|
Reads absolute X and Y coordinates from an evdev device and sends them
|
||||||
over UDP to a specified address and port.
|
over UDP to a specified address and port.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue