mous support for mouse clicking

This commit is contained in:
CactiChameleon9 2020-12-09 13:09:03 +00:00
parent 9a21c667c1
commit e4e59d127a
2 changed files with 9 additions and 6 deletions

View File

@ -6,12 +6,10 @@ from pynput.mouse import Button, Controller
import time import time
mouse=Controller() mouse=Controller()
# device's IP address # device's IP address
SERVER_HOST = "10.4.27.243" #(socket.gethostbyname(socket.gethostname())) SERVER_HOST = "192.168.1.8" #(socket.gethostbyname(socket.gethostname()))
SERVER_PORT = 10002 SERVER_PORT = 10002
# receive 4096 bytes each time # receive 4096 bytes each time
BUFFER_SIZE = 128 BUFFER_SIZE = 128
@ -79,9 +77,13 @@ while True:
print(y) print(y)
mouse.position = (x,y) mouse.position = (x,y)
if (TrR == 'R'): if (TrR == 'R'):
mouse.press(right) mouse.click(Button.right, 1)
else: print (TrR)
mouse.press(left)
else:
mouse.click(Button.left, 1)
print (TrR)
except: except:
print ("error") print ("error")

1
dataM.txt Normal file
View File

@ -0,0 +1 @@
L714,741