r/javahelp • • Mar 31 '20

Solved Can java output text as user?

So I'm trying to get java to output certain text on any open window based one the event of certain strings being entered and hitting tab.

It's essentially an autocorrect program that fills in templates.

For example, if I type "wbu" in any text field in any window and follow it with hitting tab, it should replace the previous string "wbu" with "what about you?".

I managed to figure out the logic of reading the keyboard using the native hook library, but I'm completely stuck when it comes to getting any output from my program.

What can I use to have Java output into any text field?

17 Upvotes

16 comments sorted by

View all comments

3

u/Kambz22 Intermediate Brewer Mar 31 '20

Probably just me being cautious but I'd also make sure you aren't capturing password fields to plain text, especially if you store anything.

But what the user above said will probably work :)

2

u/Jesting_Insomniac Mar 31 '20

Hey kambz, thanks for the advice!

Fortunately, nothing is being stored, it's all fed directly to the logic that the bot will be using, and I'm the only person who will have access to the program on a device that won't be able to connect to the internet, which also I'm the only person who has access to.

So I'd say it's pretty safe :)