You can try using the Robot class in java to simulate input events of the source system. Then store local variables to verify input and trigger these events through the Robot class.
Basically, for Windows Paint, when your pressure is greater than the previous pressure, fire the Robot event, which sends the CTRL and + keys to increase the width of the brush.
If you also check which application is open, you can create a separate section of code to determine which key combination to send (because keybind has [and] in Photoshop) or there is a section that allows you to specify what their binding is.
While the current iteration uses awt, the Robot is added to JavaFX / Lombard in version 3.0.
I am sure there are better solutions, but this is what I would do until I did something better. :)
source share