JDK-6763068 : Robot is generating multiple key events against single keystroke on Redhat Linux
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Other
  • OS: linux
  • CPU: x86
  • Submitted: 2008-10-23
  • Updated: 2016-03-08
  • Resolved: 2016-03-08
Related Reports
Relates :  
Description
J2SE Version (please include all output from java -version flag):
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

Does this problem occur on J2SE 5.0.x or 6.0?  Yes / No (pick one)
Yes

Operating System Configuration Information (be specific):
Redhat Linux Fedora Core release 3 (Heidelberg)
Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000000
  auto repeat delay:  250    repeat rate:  30

Bug Description:
Robot is generating multiple key events against single keystroke on Redhat Linux
(Note this appears to be the same bug as 4817479 - however that was closed as 
fixed in 1.5, yet we are still seeing this problem in 1.6)

Also we can not get all of our clients to go through and change the auto repeat delay.

Expected: when the Text Area has focus the word 'testing' should repeatedly be written into it
Actual: when the Text Area has focus garbage such as 'tttttttttttttteeeeeeeeeeeeeessssssssssssssssttttttttttttttiiiiiiiiiiiiiiiiiiiiinnnnnnnnnnnnnggggggggggg' is written into it
Test case has no delay in between.
Obviously if there was a 500 ms delay and the auto repeat was 200 ms then multiple ts should be typed.
With no delay (as in test case) then only a single t should be typed.

Comments
Not applicable anymore.
08-03-2016

EVALUATION Try the following modification of the test: private void typeKey(int aKeyCode) { long t = System.nanoTime(); robot.keyPress(aKeyCode); System.err.println(" 1 = " + (System.nanoTime() - t) / 1e6); t = System.nanoTime(); robot.keyRelease(aKeyCode); System.err.println(" 2 = " + (System.nanoTime() - t) / 1e6); System.err.println(); System.err.flush(); } It just prints the time spent by Robot in mousePressed state. On my ubuntu desktop some of the values are greater than 200ms, so if I configure my desktop auto-repeat delay <200ms, I get several chars typed.
10-11-2008

PUBLIC COMMENTS I don't see the code from 4817479 'Suggested Fix' section in AWT workspace. It seems it was never integrated, and I'm not sure if that code did solve the problem...
27-10-2008