[Tutor] Use python to listen for key strokes

Chris C mysecretrobotfactory at gmail.com
Wed Sep 16 19:11:43 EDT 2020


Hi all:

I am trying to write a program to listen for keystrokes and run functions
based on which keys are pressed!

This is what I have:

   import msvcrt
   while True:
       if msvcrt.kbhit():
           key = msvcrt.getch()
           print(key)   # just to show the result



Thanks All!


More information about the Tutor mailing list