Posted by
dscho on
Feb 11, 2008; 11:16am
URL: http://imagej.273.s1.nabble.com/Reading-from-barcode-scanner-tp3697230p3697237.html
Hi,
On Mon, 11 Feb 2008, Michael Schmid wrote:
> hmm, I do not agree that you should get keyboard events from the barcode
> scanner. See
>
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#in>
> public static final InputStream System.in
> quote
> The "standard" input stream. This stream is already open and
> ready to supply input data. Typically this stream corresponds
> to keyboard input or another input source specified by the
> host environment or user.
> end_quote
>
> As far as I know, ImageJ itself does not change System.in, so I suspect
> that the ImageJ launcher (ImageJ.app on Mac, ImageJ.exe on the PC)
> somehow modifies it. On Windows, you might try to change "javaw" into
> "java" in the ImageJ.cfg file, maybe this helps. It will create a
> console (DOS-like) window in addition to ImageJ.
ImageJ does not change System.in. The ImageJ launcher does not modify it.
Changing javaw to java does not help it.
The thing is: when one of ImageJ's windows is in the foreground, the
original _console_ is not. Therefore, it does not receive keyboard input,
but the foreground windows do. And since the console does not receive any
keyboard input, System.in is silent, too.
Hth,
Dscho