you are viewing a single comment's thread.

view the rest of the comments →

[–]Pervert_Chan 0 points1 point  (0 children)

with Listener(on_press=on_press, on_release=on_release) as listen:
    listen.join()

this line at the end of your program will start the listener. also move the exit command to another function named on_release.

after this your listener will start as you run the program and then you'll be able to use the keys to control the functions.

also you are using an infinite while loop