Why are some KeyEvent keycodes throwing "IllegalArgumentException: Invalid key code"?
<p>I'm trying to automate some processes using <code>Robot</code> and it seems certain keycodes (only symbols that require you to hold shift when typing it normally) in <code>KeyEvent</code> are throwing an <code>IllegalArgumentException</code>. This is all the code that's running in <code>main</code>:</p>

<pre><code>Robot r = new Robot();
r.keyPress(KeyEvent.VK_EXCLAMATION_MARK);
</code></pre>

<p>However, it works fine using the following workaround:</p>

<pre><code>Robot r = new Robot();
r.keyPress(KeyEvent.VK_SHIFT);
r.keyPress(KeyEvent.VK_1);
</code></pre>

<p>Any ideas why the exception is thrown? Thanks!</p>

<p>Java version: 1.6.0_23</p>
