[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 8294426: Two fingers tap generates wrong mouse modifiers on M2 MacBooks
From:       Nikita Provotorov <duke () openjdk ! org>
Date:       2022-09-30 22:30:23
Message-ID: PUxdE8gZPsQbYpACOxu8liDdcUkkfSua9If_itYkrEQ=.06e28bb0-079c-47c8-8482-baf4d1909d2a () github ! com
[Download RAW message or body]

On Fri, 30 Sep 2022 21:38:50 GMT, Nikita Provotorov <duke@openjdk.org> wrote:

> > src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java line 83:
> > 
> > > 81:         int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags);
> > > 82:         if ((jeventType == MouseEvent.MOUSE_PRESSED) && (jbuttonNumber > \
> > >                 MouseEvent.NOBUTTON)) {
> > > 83:             // 8294426: NSEvent.nsToJavaModifiers returns 0 on M2 MacBooks \
> > > if the event is generated
> > 
> > You say it returns 0, so you expect to only need to do that if jmodifiers is 0, \
> > yet you don't check that. Why not ?
> > 
> > No way to test this on an M2 so being sure it doesn't regress something is all I \
> > can offer here.
> 
> Actually I mean that it returns 0 if you're tapping without holding any modifiers \
> e.g. keyboard modifiers. But if you're tapping holding a keyboard modifier it will \
> probably return only this keyboard modifier without `InputEvent.BUTTON3_DOWN_MASK`. \
> I didn't test this case but I would expect it that looking at the implementation of \
> the `NSEvent.nsToJavaModifiers`.

I don't have an M2 device to check, but I think (judging to the code) if we add \
`jmodifiers == 0` check here then users making a tap holding the Control will receive \
the mouse events with `modifiers` == `CTRL_DOWN_MASK | BUTTON3_MASK | CTRL_MASK`, \
i.e. without modern `BUTTON3_DOWN_MASK` which is at least unusual and inconvenient.

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

PR: https://git.openjdk.org/jdk/pull/10429


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic