|
@@ -22,13 +22,20 @@ def in_monitorZone():
|
|
return False
|
|
return False
|
|
|
|
|
|
|
|
|
|
-def on_move(x, y):
|
|
|
|
- return
|
|
|
|
- # print('Pointer moved to {0}'.format(
|
|
|
|
- # (x, y)))
|
|
|
|
|
|
+def on_click(x, y, button, pressed):
|
|
|
|
|
|
|
|
+ # function:0
|
|
|
|
+ # x:
|
|
|
|
+ # y:
|
|
|
|
+ # button
|
|
|
|
+ # pressed
|
|
|
|
+ #
|
|
|
|
+ # function:1
|
|
|
|
+ # x,
|
|
|
|
+ # y,
|
|
|
|
+ # dx,
|
|
|
|
+ # dy,
|
|
|
|
|
|
-def on_click(x, y, button, pressed):
|
|
|
|
print('{0} at {1}'.format(
|
|
print('{0} at {1}'.format(
|
|
'Pressed' if pressed else 'Released',
|
|
'Pressed' if pressed else 'Released',
|
|
(x, y)))
|
|
(x, y)))
|
|
@@ -62,14 +69,12 @@ def on_scroll(x, y, dx, dy):
|
|
|
|
|
|
# Collect events until released
|
|
# Collect events until released
|
|
with mouse.Listener(
|
|
with mouse.Listener(
|
|
- on_move=on_move,
|
|
|
|
on_click=on_click,
|
|
on_click=on_click,
|
|
on_scroll=on_scroll) as listener:
|
|
on_scroll=on_scroll) as listener:
|
|
listener.join()
|
|
listener.join()
|
|
|
|
|
|
# ...or, in a non-blocking fashion:
|
|
# ...or, in a non-blocking fashion:
|
|
listener = mouse.Listener(
|
|
listener = mouse.Listener(
|
|
- on_move=on_move,
|
|
|
|
on_click=on_click,
|
|
on_click=on_click,
|
|
on_scroll=on_scroll)
|
|
on_scroll=on_scroll)
|
|
listener.start()
|
|
listener.start()
|