Creating a virtual keyboard for touchscreens in java

A

aimeejoshua

I need to create a "virtual keyboard" that can be used with
touchscreens. The idea is that if someone "touches" or clicks on a
button with the letter 'A' then an 'A' will be inserted into the text
field where the cursor is.

I'm not sure how to map the action of the button to the text field.
Any help would be appreciated.

aj
 
Y

Yamin

You can fake events in java by using a robot.

inside your actional handler for a button press on say letter 'A' do

Robot faker = new Robot();
faker .keyPress(KeyEvent.VK_A);
faker .keyRelease(KeyEvent.VK_A);

The problem you will face tough is with focus. I mean when you bring
up your new keyboard...suddenly the focus has now been changed to the
button just pressed. So who receives this keypress event?
Anyone got any ideas here?
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top