RFR: 8273506: java Robot API did the 'm' keypress and caused /awt/event/KeyEvent/KeyCharTest/KeyCharTest.html is timing out on macOS 12

Dmitry Batrak dbatrak at openjdk.java.net
Thu Apr 21 11:27:29 UTC 2022


On Wed, 20 Apr 2022 17:04:09 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

> Clear the kCGEventFlagMaskSecondaryFn flag if it is set before posting keyboard events to the system queue.

I assumed that whatever keys we set on an event being posted using `CGEventPost`, are delivered unchanged to the 'receiving' applications. But I did a test, and that doesn't seem to be the case. You're right, Quartz (or some other subsystem) does set those flags before delivering the events. Sorry for the noise.
Interestingly, extending the fix to NumPad flag (that 'sticks' in the global state similarly) doesn't work in the same way - the flag isn't being added automatically for arrow keys' KeyUp event by Quartz, but that's out of scope.

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

PR: https://git.openjdk.java.net/jdk/pull/8320



More information about the client-libs-dev mailing list