|
@@ -7,23 +7,22 @@ mouseController = Controller()
|
|
|
|
|
|
def handleMessage(properties, body):
|
|
def handleMessage(properties, body):
|
|
jsonObject = json.loads(body)
|
|
jsonObject = json.loads(body)
|
|
- print(jsonObject)
|
|
|
|
- print(time.time())
|
|
|
|
if jsonObject['function'] == 0:
|
|
if jsonObject['function'] == 0:
|
|
on_click(jsonObject['x'], jsonObject['y'], jsonObject['button'])
|
|
on_click(jsonObject['x'], jsonObject['y'], jsonObject['button'])
|
|
else:
|
|
else:
|
|
on_scroll(jsonObject['x'], jsonObject['y'], jsonObject['dx'], jsonObject['dy'])
|
|
on_scroll(jsonObject['x'], jsonObject['y'], jsonObject['dx'], jsonObject['dy'])
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
def on_click(x, y, button):
|
|
def on_click(x, y, button):
|
|
mouseController.position = (x, y)
|
|
mouseController.position = (x, y)
|
|
if 'left' in button:
|
|
if 'left' in button:
|
|
print('w')
|
|
print('w')
|
|
mouseController.click(Button.left, 1)
|
|
mouseController.click(Button.left, 1)
|
|
|
|
+ time.sleep(0.1)
|
|
else:
|
|
else:
|
|
print('2')
|
|
print('2')
|
|
mouseController.click(Button.right, 1)
|
|
mouseController.click(Button.right, 1)
|
|
|
|
+ time.sleep(0.1)
|
|
|
|
|
|
|
|
|
|
def on_scroll(x, y, dx, dy):
|
|
def on_scroll(x, y, dx, dy):
|