I was trying to position the mouse and simulate a click with Robot but it seems like that is no longer supported in JDK 10. It looks like this and says The field InputEvent.BUTTON1_MASK is deprecated since version 9.
Does anybody know a way to fix this or how to simulate a click in another way?
From its documentation:
However, it is recommended to use
InputEvent.BUTTON1_DOWN_MASK,InputEvent.BUTTON2_DOWN_MASK,InputEvent.BUTTON3_DOWN_MASKinstead.
So InputEvent.BUTTON1_DOWN_MASK is probably what you're looking for.
I believe the change is partly due to Java now supporting mice with more than three buttons.
Note: Remember to also call mouseRelease to be sure that the click is registered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With