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
mouse=Controller()
# 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
# receive 4096 bytes each time
BUFFER_SIZE = 128
@ -79,9 +77,13 @@ while True:
print(y)
mouse.position = (x,y)
if (TrR == 'R'):
mouse.press(right)
else:
mouse.press(left)
mouse.click(Button.right, 1)
print (TrR)
else:
mouse.click(Button.left, 1)
print (TrR)
except:
print ("error")

1
dataM.txt Normal file
View File

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