title: Simulate TAB keypress event in Selenium RC
body: <p>I need to simulate a tab keypress in Selenium RC, using the Java API.</p>
  
  <p>I do this after having entered some text using:</p>
  
  <pre><code>selenium.type(input, "mytext");
  </code></pre>
  
  <p>I've tried 3 alternatives to get the tab working:</p>
  
  <pre><code>selenium.keyPress(input, "\\9");
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>selenium.focus(input);
  selenium.keyPressNative("09");
  </code></pre>
  
  <p>and even:</p>
  
  <pre><code>selenium.getEval("var evt = window.document.createEvent('KeyboardEvent');evt.initKeyEvent ('keypress', true, true, window,0, 0, 0, 0,0, 9,0);window.document.getElementsByTagName('input')[2].dispatchEvent(evt);")
  </code></pre>
  
  <p>The best I can get is a "tab space" to be inserted after my text so I end up with this in the input field:</p>
  
  <pre><code>"mytext    "
  </code></pre>
  
  <p>What I actually want is to tab to the next control. Any clues? Thanks!</p>
  
  <p>(Note: I have to use tab and can not use focus or select to chose the element I want to go to, for various reasons, so no suggestions along these lines please!)</p>