From 043097a122a781885e38f85ab040998d9a892d30 Mon Sep 17 00:00:00 2001 From: Balazs Birtalan Date: Wed, 17 May 2023 10:36:20 +0000 Subject: [PATCH] Notepad++ generated in local folder (no need) --- mouseevents.py.bak | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 mouseevents.py.bak diff --git a/mouseevents.py.bak b/mouseevents.py.bak deleted file mode 100644 index 379f7b1..0000000 --- a/mouseevents.py.bak +++ /dev/null @@ -1,39 +0,0 @@ -import base -from pynput import mouse - -class MouseEvents(): - def __init__(self): - listener = mouse.Listener( - on_move=on_move, - on_click=on_click, - on_scroll=on_scroll) - listener.start() - -# MOUSE EVENTS/LISTENER -def on_move(x, y): - if base.data["move"]: - if base.data["mouse_distance_x"] == 0: - base.data["mouse_distance_x"] = base.sights.get(base.data["active_sight"]).pos().x()-x - if base.data["mouse_distance_y"] == 0: - base.data["mouse_distance_y"] = base.sights.get(base.data["active_sight"]).pos().y()-y - try: - x_point = x+base.data["mouse_distance_x"] - y_point = y+base.data["mouse_distance_y"] - #print( str(x_point) + " x " + str(y_point)) - base.sights.get(base.data["active_sight"]).move(x_point, y_point) - except: - print("e") - -def on_click(x, y, button, pressed): - if pressed: - print("pressed on " +base.data["active_sight"]) - else: - print("released") - base.data["mouse_distance_x"] = 0 - base.data["mouse_distance_y"] = 0 - base.data["move"] = False - -def on_scroll(x, y, dx, dy): - print('Scrolled {0} at {1}'.format( - 'down' if dy < 0 else 'up', - (x, y))) \ No newline at end of file