When don't MOUSE_DRAGGED events have pressed mouse buttons?
Nikita Provotorov
nikita.provotorov at jetbrains.com
Tue Jun 20 17:27:44 UTC 2023
Hello! I’m looking into the dispatching routine in AWT/Swing and stumbled
upon the following piece of code in
*java.awt.LightweightDispatcher#processMouseEvent*
<https://github.com/openjdk/jdk/blob/4a9cc8a000cafb3ad77a33710054b567e8553652/src/java.desktop/share/classes/java/awt/Container.java#L4591>
:
case MouseEvent.MOUSE_DRAGGED:
> if (isMouseGrab(e)) {
> retargetMouseEvent(met, id, e);
> }
> break;
In case of *MOUSE_DRAGGED* events, *isMouseGrab* basically checks if the
event has any pressed mouse buttons (in modifiers). I wonder why it has
been handled explicitly? AFAIU *MOUSE_DRAGGED* events always have some
pressed mouse buttons, otherwise that’s not possible to drag, don’t they?
Best regards,
Nikita Provotorov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20230620/7bdc2deb/attachment.htm>
More information about the client-libs-dev
mailing list