"virtual keyboard"

L

Linus Sylv?n

Hi

I would like to generate a key event (as if I was pressing a key on
the keyboard) on a java application that can be picked up by another
application.

Is it possible to create a "virtual keyboard" in Java (a
keyboard on screen where you click on keys with mouse to generate
keyboard input to all windows applications, not just the virtual
keyboard application itself), is that possible?

Regards,

Linus Sylvén
 
B

Boudewijn Dijkstra

Linus Sylv?n said:
Hi

I would like to generate a key event (as if I was pressing a key on
the keyboard) on a java application that can be picked up by another
application.

Is it possible to create a "virtual keyboard" in Java (a
keyboard on screen where you click on keys with mouse to generate
keyboard input to all windows applications, not just the virtual
keyboard application itself), is that possible?

No, you cannot direct a generated event outside of the JVM, using pure Java.

But I'd give the following approach a chance:
- 'wait' for mouse click
- call Window.toBack()
- 'wait' for window to go back
- call Robot.keyPress(int)
- short delay
- call Robot.keyRelease(int)
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top