Catching Keypresses on Windows with Python using MSVCRT when terminal window not in Focus
<p>I want to be able to use the <code>msvcrt</code> package in python to catch keypresses via the <code>msvcrt.getch()</code> method but it appears the the terminal window needs to be in focus for it to work. Is there a way around this?</p>

<p>I found a python wrapper for Ctypes as suggested by @IInspectable. It wraps the low_level Keyboard hooks with a nice monitor class.</p>

<p><a href="https://github.com/ethanhs/pyhooked" rel="nofollow">https://github.com/ethanhs/pyhooked</a></p>

python windows keypress msvcrt getch