Redirect Standard output to keyboard port

J

JimWilh

I have written a Class, that reads from a COM-port. I have a tag-reader
attached to my COM-port, and I want to write the ID of the readed tag
into whatever application I want, for example notepad. Not just as an
output on the running program.

That means, I will run the "Reading-application" in the background. And
every time a tag is read, the output goes to the aplication having
focus. Just like a keyboard. Anyone have an idea.

I have made the part reading the tags, so it is just the redirection
that I need help for...

Jim
 
A

Aaron Isotton

JimWilh said:
I have written a Class, that reads from a COM-port. I have a tag-reader
attached to my COM-port, and I want to write the ID of the readed tag
into whatever application I want, for example notepad. Not just as an
output on the running program.

That means, I will run the "Reading-application" in the background. And
every time a tag is read, the output goes to the aplication having
focus. Just like a keyboard. Anyone have an idea.

This is quite platform-specific, so I doubt you can do this in Java
natively. For example, if you log in to a server via SSH (or remote
desktop, or some other remote access tools) then you'd probably not want
the input to come from the "keyboard", but from whatever source the
"normal" input is coming from.

For some programs, this might be "standard input", but not for the ones
interfacing with the "input" in a more low-level way (such as most text
editors).

You might want to have a look at JNI and write some platform-dependent code.

It is probably much easier to generate the output in your program, and
copy it to the clipboard (or X buffer or whatever). Not exactly what you
asked for, but maybe that's an alternative.

Greetings,
Aaron
 
L

Lucy

JimWilh said:
I have written a Class, that reads from a COM-port. I have a tag-reader
attached to my COM-port, and I want to write the ID of the readed tag
into whatever application I want, for example notepad. Not just as an
output on the running program.

That means, I will run the "Reading-application" in the background. And
every time a tag is read, the output goes to the aplication having
focus. Just like a keyboard. Anyone have an idea.

I have made the part reading the tags, so it is just the redirection
that I need help for...

Jim
Try using a pipe.

java myjavaprogram | someotherprogram
 
J

JimWilh

This application will run on Windows XP or Windows 2000. And it doesn't
matter if it is platform dependent. It should be used to load text into
an applet. And since the applet can't interact with the local COM-port
I have to think of other solutions.

Anyone have an idea?

Jim
 
J

JimWilh

I have tried to use the class from an applet, but my knowledge of
applets is limited.
Which libraries does the applet use? Is it the local libraries on the
client, or th libraries on the server, in which the applet reside?
Doesn't the applet have limited access to the client?
 
A

Andrew Thompson

I have tried to use the class from an applet, but my knowledge of
applets is limited.
Which libraries does the applet use? Is it the local libraries on the
client, or th libraries on the server, in which the applet reside?
Doesn't the applet have limited access to the client?

Move this thread (or repost it) over to c.l.j.help and I will continue..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top