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

Solaris11 x64/x86, java.awt.Robot generates duplicated key events.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 7
    • client-libs
    • None
    • x86
    • solaris_nevada

      This problem occurs only on Solaris 11 x64/x86. Solaris 11 sparc is not tested. When using java.awt.Robot to generate key event, the key is generated twice. jdk7 and 6ur (6u23, 6u25) have the same behavior. Other platforms don't have the issue.

      Steps to follow to reproduce the problem:
      Compile and run attached program TestRobot.java

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

      public class TestRobot {

          public static Robot robot = null;

          public static void initRobot() throws AWTException {
              if(robot == null) {
                  robot = new Robot();
                  robot.setAutoDelay(500);
              }
          }

          public static void main(String args[]) {
             try {
                      initRobot();
                  } catch (AWTException e) {
                      e.printStackTrace();
                  }

              robot.delay(2000);
              robot.keyPress(KeyEvent.VK_A);
              robot.keyRelease(KeyEvent.VK_A);
          }
      }

      ******

      BUG:
      The sequence keyPress-keyRelease should just generate character 'a' once. This works fine on platforms other than Solaris11. But on Solaris 11, 'a' is generated twice.

      Because of this behavior, on Solaris 11, the automation testing using java.awt.Robot will be impacted.

            denis Denis Fokin (Inactive)
            jennyh Jenny Huang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: