I have a swing Java application (A) that launches another application (B) using Runtime.getRuntime().exec()
when a certain button is pressed.
Is it possible to set a certain Key Hook so that when the application (B) is open and active, it changes the buttons (for example, when you press "Q", in fact, the "H" button is pressed, and so on). And a similar situation for the mouse (for example, if "Mouse Mid" or "Mouse Wheel" is pressed, in fact another button is pressed, for example "T").
Ideally, it should work for all operating systems if possible, but Windows primarily.
Please tell me if it is possible to implement this at all, I will be glad to any advice or examples.