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

RFE: Need API to get mouse and keyboard's Desktop specific properties

XMLWordPrintable

    • Cause Known
    • generic
    • generic

      Right now automation in java using java.awt.Robot class have several
      constraints and users have to specify arbitary delays to overcome
      these problems and because of these delays testcases become less
      portable across different platforms.

      Following are the constrainsts which can I point out:
      1) If you want to click the mouse than there must be call to mousePress
        & mouseRelease api with some specific amount of delay in between,
        There should be some way to get the delay from some API instead of
        user putting some arbitary value. Maybe attribute can be added in
        Desktop Properties which can be accessed by Toolkit. for e.g
        Toolkit.getDefaultToolkit().getDesktopProperty("awt.mouse.clickDelay");
        Optionally a API mouseClick can be added in Robot class which wraps
        all these details from naive user.
        something like
        public void mouseClick(int buttons) {
          mousePress(buttons);
          // Give here OS specific delay
          mouseRelease(buttons);
        }

      2) Above case applies for double click of mouse also.

      3) Similarly there should be some property/api to get following
         keyboard desktop property.
         - Keyboard repeat delay - If you keep the keyboard key pressed than this is
          the time after which it will repeat the keyPress event
         - Keyboard repeat rate - Rate at which character is repeated when key is
          holded for a while.
          Optionally a wrapper can be provided in Robot class which types the key
          i.e instead of user making call to keyPress and keyRelease, user just need
          to make one call.
          something like
          public void keyType(int keycode) {
              keyPress(keycode);
              // Give here OS specific delay
              keyRelease(keycode);
          }

      ###@###.### 2003-12-11

            Unassigned Unassigned
            hsinghsunw Hemant Singh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: