RFR: 8278759 : PointerEvent: buttons property set to 0 when mouse down [v2]

Hima Bindu Meda duke at openjdk.java.net
Fri Feb 25 18:13:02 UTC 2022


On Fri, 25 Feb 2022 13:35:16 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> tests/system/src/test/java/test/robot/javafx/web/PointerEventTest.java line 212:
>> 
>>> 210:         Util.runAndWait(() -> {
>>> 211:             robot.mouseRelease(MouseButton.PRIMARY, MouseButton.MIDDLE, MouseButton.SECONDARY);
>>> 212:             robot.mouseClick(MouseButton.PRIMARY);
>> 
>> I presume clicking the left mouse button is done to dismiss the popup that will happens when dragging with the right mouse button? This doesn't work on Windows, so subsequent tests fail. If you change it to pressing the `ESC` key, then it should work:
>> 
>> 
>>     robot.keyType(KeyCode.ESCAPE);
>
> Alternatively, moving the mouse up and/or to the left after releasing all the buttons and before clicking the middle button will work (on Windows the popup doesn't display until after you release the middle button, and is displayed at the then-current mouse position). Pressing the ESC seems easier, but it's up to you.

Added code to press ESC key.Thanks for the sharing the observation.

-------------

PR: https://git.openjdk.java.net/jfx/pull/742


More information about the openjfx-dev mailing list