Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8286055

fn became pressed but not released after pressing some keys

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 11, 17
    • Fix Version/s: tbd
    • Component/s: client-libs
    • Labels:

      Description

      After pressing some keys like ↖ (KeyEvent.VK_HOME), ↘ (KeyEvent.VK_END), ⌦ (KeyEvent.VK_DELETE) and releasing them by java.awt.Robot the [fn] looks like pressed but not released.
      Here is an example

      import java.awt.*;
      import java.awt.event.KeyEvent;

      public class MacFnReproducer {

          public static void main(String[] args) throws AWTException {
              final Robot robot = new Robot();
              robot.keyPress(KeyEvent.VK_END);
              robot.keyRelease(KeyEvent.VK_END);

      //robot.keyRelease(KeyEvent.VK_RIGHT);

              robot.delay(2500);
              robot.keyPress(KeyEvent.VK_C);
              robot.keyRelease(KeyEvent.VK_C);
              robot.delay(2500);
          }
      }

      During execution of this app on macOS Monterey (e.g. 12.3.1) the Notification Center window appears (on the upper right corner) like the combination [fn]+[c] was pressed. The issue was not observed on BigSur (probably because the shortcut [fn]+[c] does not work there).

      Please note if after releasing KeyEvent.VK_END to invoke releasing KeyEvent.VK_RIGHT then [fn] is also released and press-release [c] works as expected i.e. Notification Center does not appear.

      The issue was observed with

      openjdk version "19-ea" 2022-09-20
      OpenJDK Runtime Environment (build 19-ea+20-1369)
      OpenJDK 64-Bit Server VM (build 19-ea+20-1369, mixed mode, sharing)

      It can be reproduced with 11, 17 as well.
      It cannot be reproduced with 8

        Attachments

          Activity

            People

            Assignee:
            kizune Alexander Zuev
            Reporter:
            vprovodin Vitaly Provodin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: