JDK-4966881 : RFE: Need API to get mouse and keyboard's Desktop specific properties
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2003-12-11
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
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

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
17-09-2004

EVALUATION This would be good functionality to have - especially the keyboard info. The lack of a way to get keyboard autorepeat rates has caused a lot of problems for SQE and SQA. I'll commit this to mustang, but it would be nice if we could find a solution earlier. ###@###.### 2003-12-11
11-12-2003