Answer the question
In order to leave comments, you need to log in
Endless loop with button exit, how to implement?
from ahk import AHK, Hotkey
import time
import keyboard
ahk = AHK()
if keyboard.is_pressed('Page_Up'):
while True:
ahk.key_press('TAB')
if keyboard.is_pressed('Page_Down'):
print("Stoping...")
break
Answer the question
In order to leave comments, you need to log in
I think you wanted to do something like this
from ahk import AHK, Hotkey
import time
import keyboard
ahk = AHK()
while True:
if keyboard.is_pressed('Page_Up'):
while True:
ahk.key_press('TAB')
if keyboard.is_pressed('Page_Down'):
print("Stoping...")
break
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question