I am sorry for my English. It only detects once when I hold down the left click on the mouse.I want it to detect as long as I hold it down.
def Dataprint(event=None):
UDP_IP_ADDRESS_SERVER = "xxx.xxx.xx.xxx"
UDP_PORT_SERVER = 7005
message = "#upto"
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
client.sendto(message.encode('utf-8'), (UDP_IP_ADDRESS_SERVER, UDP_PORT_SERVER))
print("sent")
time.sleep(0.01)
ttk.Label(TAB2, text="bos",font=("Arial",20),foreground="#fff",borderwidth=2,background="#7b7bc0",width=9).grid(column=0, row=4, padx=10, pady=10)
emptyup=ttk.Button(TAB2,text="up")
emptyup.grid(column=0, row=5, padx=10, pady=10)
emptyup.bind("<Button-1>",Dataprint)