title: Java bot using the Robot class
body: <p>I'm trying to create a game bot using the Robot class.
  I have tried the following code to perform a right click of the mouse:</p>
  
  <pre><code>robot.mousePress(InputEvent.BUTTON3_MASK);
  robot.mouseRelease(InputEvent.BUTTON3_MASK);
  </code></pre>
  
  <p>And it worked.</p>
  
  <p>I'm testing it on a client side 3d online game.</p>
  
  <p>Pressing the key "1" should perform some kind of a movement ingame, and when I tried the following code it didn't worked:</p>
  
  <pre><code>robot.keyPress(KeyEvent.VK_1);
  robot.keyRelease(KeyEvent.VK_1);
  </code></pre>
  
  <p>But it did worked when I used that code while speaking in the chat in game.</p>
  
  <p>It's been tested over and over and I keep getting the same result. </p>
  
  <p>Is it something that I have done wrong?or somehow the game detect that I'm not the one that pressing that key.</p>