title: Detecting Key Presses using win32api in Python
body: <p>I'm trying to break a loop in Python with a specific key press using win32api. How would one go about this?</p>
  
  <p>What is the actual version of <strong>win32api.KeyPress('H')</strong>, in the following code? </p>
  
  <p><strong>Revised:</strong></p>
  
  <pre><code>import win32api
  
  while True :
      cp = win32api.GetCursorPos()
      print cp
      if win32api.KeyPress('H') == True :
          break
  </code></pre>
  
  <p>I want to be able to break a loop by pressing the <strong>h</strong> key. </p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I'm attempting to make a program that repeatedly reports mouse positions and I need a mechanism to exit said program.  </p>
  
  <p>See revised code. </p>