yahia stackflow
yahia stackflow

Reputation: 59

Java Robot , Fixing keyboard issue

I have an issue on my laptop keyboard , whenever I press "p" , it types an "o" , Im too lazy that I want to fix this using java.awt.Robot , how can I do that in code ?

Upvotes: 1

Views: 35

Answers (1)

rzwitserloot
rzwitserloot

Reputation: 102832

You don't, java is not the kind of language that does a particularly good job at such hardware/OS specific jobs. Depending on your OS, there are driver/kernel based solutions. For example, carabiner on a mac. autohotkey on windows, etc.

Specifically, it is non-trivial (requires hacks or JNA/JNI) to have all keyboard input redirect to some java process instead of the active app, and robot only gets you so far. Lots of apps hook up to a more direct line of input and thus completely ignore Robot.

Stuff like carabiner etc. don't suffer from those issues.

Upvotes: 1

Related Questions