Created
July 26, 2020 14:40
-
-
Save yusufusta/165c5736922e213b5852e1f53be1eab2 to your computer and use it in GitHub Desktop.
sol click başlatır sağ click durdurur
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
python3 -m pip install pyautogui
python3 -m pip install pynput