title: Sendkey Function Enter Key Issue
body: <p>So here is my problem , I've been trying to simulate various key events with the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx" rel="nofollow">sendinput()</a> function, I even wrote functions to simulate complex key events like winkey+D, alt+f4 etc using that function , anyway 
  everything worked fine till I decided to try out the enter key aka return with virtual keycode  VK_RETURN as provided by this nice msdn <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx" rel="nofollow">list</a> of VK codes, the thing is that it doesn't work </p>
  
  <p>now, i am guessing that 3 things can be wrong with this enter key , </p>
  
  <ol>
  <li><p>the virtual key code for enter and the value that the pc keyboard actually uses are not the same </p></li>
  <li><p>there is something wrong in the code typos wrong codes , bad calls etc; 
  something i'm not so sure since send input works for the rest of the keys tested so far</p></li>
  <li><p>the enter, return carriage, return or whatever the superstar of keyboard keys called just doesn't work like the other buttons so my code is not right for it </p></li>
  </ol>
  
  <p>note: if its the 1 , can you pls enlighten on how do i get the right value of a keycode, programmatically for a given button without relying on static resources like msdn vk list </p>
  
  <p>anyway here is my snippet</p>
  
  <p>i make an input struct like this and assign it as keyboard input</p>
  
  <pre><code>             INPUT Keybord;
           Keybord.type = INPUT_KEYBOARD;
           Keybord.ki.wScan = 0;
           Keybord.ki.time = 0;
           Keybord.ki.dwExtraInfo = 0;
  </code></pre>
  
  <p>here i  assign a button VK, i use a struct because i simulate complex events  too<br>
  in this case the the key press simulation function that follows works just fine and a tab is pressed</p>
  
  <pre><code> cndex[38].primary = VK_TAB;
  </code></pre>
  
  <p>now here is the troublemaker,i assign it  this way</p>
  
  <pre><code> cndex[39].primary =  VK_RETURN;
  </code></pre>
  
  <p>here is my  key click function , the first call presses the and the second releases it</p>
  
  <pre><code>        void Simple_press(int i){
       Keybord.ki.wVk = cndex[i].primary;
       Keybord.ki.dwFlags = 0;
       SendInput(1, &amp;Keybord, sizeof(INPUT));
  
       Keybord.ki.dwFlags = KEYEVENTF_KEYUP;
       SendInput(1, &amp;Keybord, sizeof(INPUT));
  
   };
  </code></pre>
  
  <p>another note is that i don't want to use the sendKeys function ,  its sluggish and 
   it doesn't work for "{ENTER}" argument either</p>