RFR: 8311922: [macOS] right-Option key fails to generate release event
Damon Nguyen
dnguyen at openjdk.org
Mon Aug 28 21:24:45 UTC 2023
On Fri, 25 Aug 2023 17:53:51 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:
> Previously, a new key combination involving the option key was added to Aqua LAF for JTextAreas. In doing so, some code was removed that created this regression. The regression caused the right option key on Mac OS to incorrectly show another KeyPressed event instead of a KeyReleased event when pressing and releasing the key. Additionally, the location of the key was 'standard' instead of 'right'. Adding back the key mask and its following code resolves the issue and doesn't cause any other CI tests to fail.
>
> The headful test included displays the key events as they're pressed. After the changes, the test correctly shows the right option key's KeyPressed and KeyReleased events and shows the location as 'right'.
> I guess it was removed in as part of JDK-8267374 fix. Please see [PR#9230](https://github.com/openjdk/jdk/pull/9230) where it was concluded that we dont need ALT_GRAPH mapping for macos and RightOption key was mapped to ALT_GRAPH which makes Option key not work [#9230 (comment)](https://github.com/openjdk/jdk/pull/9230#issuecomment-1165315655) [#9230 (comment)](https://github.com/openjdk/jdk/pull/9230#discussion_r906279285)
>
> Please run the regression test added/modified to see it does not regress those, mainly test/jdk/javax/swing/JTextArea/TestAltUpDown.java
I see the comments. I removed the code that was removed again and instead edited the existing NSAlternateKeyMask. Fix now shows the correct key code as well. TestAltUpDown passes as well as my new test.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15432#issuecomment-1696426813
More information about the client-libs-dev
mailing list