title: pygame capture keyboard events when window not in focus
body: <p>I wrote a simple python script that gives control over the cursor to a joystick. My way to find out how this works is documented <a href="https://superuser.com/questions/496204/control-mouse-with-joystick-windows">here</a>. Now that works flawlessly but, as soon as I start the script to use the joystick, the mouse is useless, because my python routine sets the value back to its original, whenever a new joystick event comes in. </p>
  
  <p>Thus I want my joystick events to be ignored as long as a key of the keyboard is pressed. I came across the <code>pygame.key.get_pressed()</code> method but this seems to work only, if the pygame window is in focus. I want this script running in background. Should I start using non-pygame events to listen to the keyboard or are there ways to keep track of the keyboard events analogue to the joystick events, which are recognized in background, via pygame?</p>