title: Qt - c++ simulate keypress
body: <p>I'm trying to create a simple bot in Qt and need therefor a way of simulating keyboard presses OUTSIDE the Qt application itself. </p>
  
  <p>I've successfully made this possible by using the "old" keybd_event</p>
  
  <pre><code>keybd_event(Qt::Key_A,0,0, 0); // Pressing the 'A-button"
  </code></pre>
  
  <p>and that works out fine. But i can't make it when i'm trying to execute a 'select all' command which needs two buttons to be pressed at once.</p>
  
  <p>As i researched the problem on Google i was refereed to the '<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646304%28v=vs.85%29.aspx" rel="nofollow">SendInput</a>' function with the message 'This function (keybd_event) has been superseded. Use SendInput instead.'</p>
  
  <p>The problem now is that I've little knowledge of windows API and especially in the contex of "Qt" and would like guidance on how to get started.</p>