mous support for mouse clicking
This commit is contained in:
@ -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)
|
||||||
|
print (TrR)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
mouse.press(left)
|
mouse.click(Button.left, 1)
|
||||||
|
print (TrR)
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print ("error")
|
print ("error")
|
||||||
|
Reference in New Issue
Block a user