JDK-5106147 : Robot is generating multiple key events against single keystroke on Redhat Linux
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: linux_redhat_9.0
  • CPU: x86
  • Submitted: 2004-09-23
  • Updated: 2004-09-23
  • Resolved: 2004-09-23
Related Reports
Relates :  
Description
I am not sure if this is a duplicate of 4817479. If yes, please reopen 4817479. It happens in automated tests of NetBeans IDE that a shorcut action executed by Robot is done multiple times. I created a test case which shows that after Robot.keyPressed() it behaves differently on window and on Linux. On windows a KeyListener receives just one KeyPress event but on Linux the KeyListener receives multiple KeyPressed and surprisingly KeyReleased events. Run "java TestRobot" and click the "Test it" button. On Linux a counter of events never stops.

Redhat Linux 2.4.18 - Gnome
Redhat Linux 2.4.19-4GB JDS2 Gnome
JDK1.5.0-b63

Comments
EVALUATION Name: df153228 Date: 09/23/2004 It is a known behave. On linux system X server is responsible for auto repeat and for Solaris, Windows systems is not. You could reproduce the same situation if you place delay between invocations of keyPress() and keyRelease() methods. In this case X server turn on autorepeat after period which is in it's settings. In spite of everything it is necessary to invoke keyRelease() method on Robot. ###@###.### ======================================================================
24-09-2004