On Fri, 25 Aug 2023 17:53:51 GMT, Damon Nguyen <dngu...@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'. @DamonGuy Tested with the patch. Observed that the key code and extended modifier differ for left vs right option key. This is not the case for other left/right keys such as Shift, Command. I think some extra flags are being set in case of option key. LEFT SHIFT KEY ----------------- KEY PRESSED: key code = 16 (⇧) extended modifiers = 64 (⇧) action key? NO key location: left KEY RELEASED: key code = 16 (⇧) extended modifiers = 0 (no extended modifiers) action key? NO key location: left RIGHT SHIFT KEY ----------------- KEY PRESSED: key code = 16 (⇧) extended modifiers = 64 (⇧) action key? NO key location: right KEY RELEASED: key code = 16 (⇧) extended modifiers = 0 (no extended modifiers) action key? NO key location: right ------------------------------------------------------------------ LEFT OPTION KEY ------------------ KEY PRESSED: key code = 18 (⌥) extended modifiers = 512 (⌥) action key? NO key location: left KEY RELEASED: key code = 18 (⌥) extended modifiers = 0 (no extended modifiers) action key? NO key location: left RIGHT OPTION KEY ------------------- KEY PRESSED: key code = 65406 (⌥) extended modifiers = 8704 (⌥+⌥) action key? NO key location: right KEY RELEASED: key code = 65406 (⌥) extended modifiers = 0 (no extended modifiers) action key? NO key location: right ------------- PR Comment: https://git.openjdk.org/jdk/pull/15432#issuecomment-1693990117