sample
This commit is contained in:
		
							parent
							
								
									552550676b
								
							
						
					
					
						commit
						8c169188d8
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		
							
								
								
									
										5
									
								
								main.py
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								main.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue