sample
This commit is contained in:
		
							parent
							
								
									552550676b
								
							
						
					
					
						commit
						8c169188d8
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		
							
								
								
									
										3
									
								
								main.py
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								main.py
									
										
									
									
									
								
							| 
						 | 
					@ -6,6 +6,8 @@ import sys
 | 
				
			||||||
import libevdev
 | 
					import libevdev
 | 
				
			||||||
#from libevdev import ecodes
 | 
					#from libevdev import ecodes
 | 
				
			||||||
MULTICAST_TTL = 4
 | 
					MULTICAST_TTL = 4
 | 
				
			||||||
 | 
					def main(device_path, dest_ip, dest_port):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def send(sock,x,y):
 | 
					    def send(sock,x,y):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        packet = struct.pack('<HH', x,y)
 | 
					        packet = struct.pack('<HH', x,y)
 | 
				
			||||||
| 
						 | 
					@ -14,7 +16,6 @@ def send(sock,x,y):
 | 
				
			||||||
        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