title: How to capture keyboard input in Blender using Python
body: <p>I am using blender 2.6 and I have written a script to do a common translation that I need for keyframing an animation. How can I trigger the function using a keyboard shortcut instead of repeatedly pressing a custom panel button? </p>
  
  <p>I want something like onkeypress() but outside of the game engine.</p>
  
  <p>It works in several directions so it would be useful to link to a combination of a button and an arrow key.</p>
  
  <p>This is for aligning with background movie frames, frame by frame. So this is why I want a better solution than firing the scripts by clicking with the mouse.</p>