1

I need a way to do what is described in the first answer to this question: Type a String using java.awt.Robot

Only I would like to avoid using the clipboard. Is there a generic way to do it without?

(Other answers to the question address printing some hard-coded keys, but they don't help me print "Hello, world!")

1
  • See also this. Commented May 6, 2015 at 20:35

1 Answer 1

1

You can use javax.swing.KeyStroke to transform the characters in your string into keycodes. For each key code, call Robot.keyPress(...), Robot.keyRelease(...) as you are doing in your previous question

Sign up to request clarification or add additional context in comments.

1 Comment

"transform the characters in your string into keycodes" Not a simple task at all!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.