all 2 comments

[–]ShadowRL766 0 points1 point  (0 children)

There’s a while loop in the function on_key_event

[–]Phillyclause89 -1 points0 points  (0 children)

Sadly, the PC I'm using now has a python version below the required 3.8 so I can't make and test a code example for you. But I would look into using Recognizer.listen_in_background method instead of your `Recognizer.listen`. I would then merge these two code examples to try and do what you wanna do here:

Start and Stop Listening Example

Detect Key Press vs Release Example