Skip to content

Instantly share code, notes, and snippets.

@yusufusta
Created July 26, 2020 14:40
Show Gist options
  • Save yusufusta/165c5736922e213b5852e1f53be1eab2 to your computer and use it in GitHub Desktop.
Save yusufusta/165c5736922e213b5852e1f53be1eab2 to your computer and use it in GitHub Desktop.
sol click başlatır sağ click durdurur
import pyautogui
from pynput.mouse import *
pause = False
running = True
def on_click(x, y, button, pressed):
global pause
if button == Button.right:
pause = True
elif button == Button.left:
if pause:
pause = False
return x, y
def main():
lis = Listener(on_click=on_click)
lis.start()
while running:
if not pause:
pyautogui.mouseDown(button='left')
pyautogui.mouseUp(button='left')
pyautogui.mouseDown(button='left')
pyautogui.mouseUp(button='left')
lis.stop()
if __name__ == "__main__":
main()
@yusufusta
Copy link
Author

python3 -m pip install pyautogui
python3 -m pip install pynput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment