kennyhml/pyinterception

key detection

Closed this issue · 3 comments

dvdco commented

is there a way to detect if an key is pressed without blocking the program? similar to this
while True: if mouse_left_is_clicked: break time.sleep(0.1)

dvdco commented

while True:
if mouse_left_is_clicked:
break
else:
time.sleep(0.1)

Hey @dvdco,

no, this library offers no such feature. If you need this to be part of whatever youre doing it suggest you use another module for it.

Also, since youre talking about "without blocking the program", that would mean it has to be threaded,

Id suggest you look here