Skip to content

Instantly share code, notes, and snippets.

@CCXXXI
Last active April 30, 2022 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CCXXXI/9eddc6b45632b16b356bd29a1e34e283 to your computer and use it in GitHub Desktop.
Save CCXXXI/9eddc6b45632b16b356bd29a1e34e283 to your computer and use it in GitHub Desktop.
Press "1" to start. Press "0" to stop.
import keyboard
import pydirectinput as pyautogui
pyautogui.PAUSE = 0
def f():
while not keyboard.is_pressed("0"):
pyautogui.press("up")
pyautogui.press("enter")
if __name__ == "__main__":
keyboard.add_hotkey("1", f)
keyboard.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment