import time import pyautogui as pepe #813 271 #838, 704 import keyboard exitProgram = False # define a function that will be executed when the hotkey is pressed def hotkey_pressed(): global exitProgram exitProgram=True quit() # register the hotkey using the keyboard library keyboard.add_hotkey('command', hotkey_pressed) print(pepe.position()) islem = input("İşlem Gir: ") time.sleep(5) print(pepe.position()) while exitProgram: quit() while not exitProgram: if islem == "sag": pepe.mouseDown() pepe.moveTo(838, 702) time.sleep(0.7) pepe.mouseUp() pepe.keyDown('D') time.sleep(0.102) pepe.keyUp('D')