I have a program which uses pynput to listen for the esc key to be pressed, but it is really ugly. This is a bit of a long post but I think there\'s a simple solution, just