title: Python send keys on windows
body: <p>I'm trying to send keyboard commands through python 2.7 on a windows machine. I understand that the SendKeys module does not work with 2.7. So I use keybd_event from the win32 api instead. </p>
  
  <p>The key that i want to send is shift+left to select a word. This is the code:</p>
  
  <pre><code>win32api.keybd_event(win32con.VK_LSHIFT,0,win32con.KEYEVENTF_EXTENDEDKEY | 0,0)
  win32api.keybd_event(win32con.VK_LEFT,0,0,0)
  win32api.keybd_event(win32con.VK_LSHIFT,0,win32con.KEYEVENTF_EXTENDEDKEY | win32con.KEYEVENTF_KEYUP,0)
  </code></pre>
  
  <p>This all works. However, the shift key stays depressed! Even after I kill the process. The only way to release the shift key after is to physically press capslock, then shift + a key, then capslock off. Its very similiar to this problem: <a href="http://www.bigresource.com/Tracker/Track-vb-RvVMlrAbZn/" rel="nofollow">http://www.bigresource.com/Tracker/Track-vb-RvVMlrAbZn/</a></p>
  
  <p>Do you have any idea what to do?</p>
  
  <p>Thanks in advance!</p>