mixmastamyk / console

Comprehensive utility library for terminals. “Better… Stronger… Faster.”
GNU Lesser General Public License v3.0
34 stars 5 forks source link

wait_key returns bytes on Windows #15

Open mixmastamyk opened 1 year ago

mixmastamyk commented 1 year ago

https://stackoverflow.com/questions/983354/how-do-i-wait-for-a-pressed-key/34956791?noredirect=1#comment130810896_34956791

>>> from console.utils import wait_key

>>> wait_key()
'h'

Looks like we want msvcrt.getwch() and some function key pre-processing:

https://docs.python.org/3.8/library/msvcrt.html#msvcrt.getwch