mous support for mouse clicking
This commit is contained in:
parent
9a21c667c1
commit
e4e59d127a
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user