Waiting for a Java keypress
<p>The application I am wishing to write is quite large, but requires being run as a service.  I plan on using FireDaemon to convert it and run it as a service, but need to have it do nothing until a specific key is pushed.</p>

<p>I tried using <code>DataInputStream</code> and a do/while loop which would wait for a key press, something like this:</p>

<pre><code>do {
   char keyPressed = input.readChar();
} while (keyPushed != null);

System.out.println("You pushed: " + keyPushed);
</code></pre>

<p>There isn't all that much information on this simple topic and I find that odd.  In Basic we used to use inkey$ which would wait for a key, Java has to have something similar, but I just can't put my finger on it.</p>

<p>Any help would be nice.</p>

<p>Thanks.
Bob Grant,
Pennsylvania</p>
