|
Quick Lists
|
|
Bug ID:
|
4817479
|
|
Votes
|
0
|
|
Synopsis
|
Robot is generating multiple key events against single keystroke on Redhat Linux
|
|
Category
|
java:classes_awt
|
|
Reported Against
|
1.5
, tiger
, tiger-beta
, mantis-beta
|
|
Release Fixed
|
1.5(tiger-b35)
|
|
State
|
10-Fix Delivered,
Verified,
bug
|
|
Priority:
|
3-Medium
|
|
Related Bugs
|
4984648
,
6763068
,
4978154
,
4812771
,
4153069
,
4966881
,
5030154
,
4945124
,
5106147
|
|
Submit Date
|
12-FEB-2003
|
|
Description
|
Tested_Java_Release : 1.4.2 build-16
Tested_Java_Location : /net/koori.sfbay/p/jdk01/jdk/1.4.2/beta/b16/binaries/linux-i586
Tested_Machine_Name : sqe-jpi-05/dnm-dtf-016
Tested O/S : customer 7.3/ customer 8.0
Problem Description:
Combination of methods keyPress(KeyCode) and keyRelease(KeyCode) in java.awt.Robot are not working as desired on Redhat linux8.0. Somehow it's generating multiple key events against the single keystroke(key is pressed and released once). Same piece of code works fine on linux7.3 and all other windows and solaris platforms
Steps to Reproduce :
--------------------
a)Single key
1) Try to run the attached Robot1.java file. In this file key "t" is tried to press and release just only once using robot.
2) if you see the the text on the TextField as "tt" instead of "t" then the bug is reproduced
b)key combinations
1) Try to run the attached Robot.java file. In this file cliboard is being set with text "*Testing Robot*" and the same text is tried to get pasted on the textfield using CNTRL-V key combination.
2) If Instead of "*Testing Robot*" you happened to see "*Testing Robot**Testing Robot**TestingRobot**TestingRobot*..............*TestingRobot**TestingRobot*vvvvvvvvvvvvvvv" then the bug is reproduced
The bug is also getting reflected to the Prorobot. File using Prorobot(ProrobotTest.java) instead of Robot has been attached with the bug report.
--------------------------------------------------------------------------------
One of the workaround suggested i.e Increase the key repeat delay on the customer 8.0 machine works fine. One has to set the delay to maximum.
But the reducing the robot delay within the code is not changing the behavior at all. We are specifying delays at two places (RobotTest1.java and RobotTest.java), one before the keyPress and one between the keyPress and keyRelease. Below are the code snipets
RobotTest1.java
Delay1 robot.setAutoDelay(500);
robot.keyPress(java.awt.event.KeyEvent.VK_T);
Delay2 robot.setAutoDelay(500);
robot.keyRelease(java.awt.event.KeyEvent.VK_T);
RobotTest.java
sClip.setContents(content,content);
Delay1 robot.setAutoDelay(1000);
robot.keyPress(java.awt.event.KeyEvent.VK_CONTROL);
robot.keyPress(java.awt.event.KeyEvent.VK_V);
Delay2 robot.setAutoDelay(500);
robot.keyRelease(java.awt.event.KeyEvent.VK_CONTROL);
robot.keyRelease(java.awt.event.KeyEvent.VK_V);
Following behavior has been noticed while evaluating the bug:
1) If the Delay1 is there the Delay2 becomes irrelevant i.e. one can still notice the repetion of keys even the Delay2 is completely removed.
2) If the Delay1 is removed then it's work fine even without touching the Delay2 at all.
It's quite interesting that what Delay1 has to do with keyPress and KeyRelease combination which is called before these two events has been called. Also we can't get rid of Delay1 ,as in our test cases we have to make sure that the Cliboard has been set with the desired contents so that the same contents can later be pasted to desired location to proceed with testing.
xxxxx@xxxxx 2003-03-03
========================================================================================================================
su- xxxxx@xxxxx 2003-10-28
JDK: mantis, tiger
Platforms: RH8, RH9, Mercury, SuSE8.2, SLES
Window Manager: Metacity
Failed testcases: 31 testcases:
4812771 (dup of 4817479, this bug.)
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/DisableTraversalKeyTest/DisableTraversalKeyTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Lw/DisableTraversalKeyTest/DisableTraversalKeyTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/DisableTraversalKeyTest/DisableTraversalKeyTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/DisableTraversalKeyTest/DisableTraversalKeyTest.html
4814272 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/ForwardReversetraversalTest/ForwardReverseTraversalTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Lw/ForwardReverseTraversalTest/ForwardReverseTraversalTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/ForwardReverseTraversalTest/ForwardReverseTraversalTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/ForwardReverseTraversalTest/ForwardReverseTraversalTest.html
4814244 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/TemporaryFocusEventTest/TemporaryFocusEventTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Lw/TemporaryFocusEventTest/TemporaryFocusEventTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/TemporaryFocusEventTest/TemporaryFocusEventTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/TemporaryFocusEventTest/TemporaryFocusEventTest.html
4814233 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/SetTraversalPolicyTest/SetTraversalPolicyTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Lw/SetTraversalPolicyTest/SetTraversalPolicyTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/SetTraversalPolicyTest/SetTraversalPolicyTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/SetTraversalPolicyTest/SetTraversalPolicyTest.html
4814222 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/OppositeComponentTest/OppositeComponentTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Lw/OppositeComponentTest/OppositeComponentTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/OppositeComponentTest/OppositeComponentTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/OppositeComponentTest/OppositeComponentTest.html
4812845 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/KeyboardFocusManagerEventTest/KeyboardFocusManagerEventTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/KeyboardFocusManagerEventTest/KeyboardFocusManagerEventTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/KeyboardFocusManagerEventTest/KeyboardFocusManagerEventTest.html
4812831 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/FocusTraversalTest/FocusTraversalTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Lw/FocusTraversalTest/FocusTraversalTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/FocusTraversalTest/FocusTraversalTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/FocusTraversalTest/FocusTraversalTest.html
4812816 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/AWT/FocusCycleTest/FocusCycleTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Swing/FocusCycleTest/FocusCycleTest.html
4812809 (dup of 4812771)
AWT_Merlin_WS/MerlinFocus/src/Automated/Lw/DefaultTraversalKeyTest/DefaultTraversalKeyTest.html
AWT_Merlin_WS/MerlinFocus/src/Automated/Mw/DefaultTraversalKeyTest/DefaultTraversalKeyTest.html
|
|
Work Around
|
Increase the key repeat delay on the RedHat 8.0 machine and/or decrease the amount of delay used by Robot.
xxxxx@xxxxx 2003-02-19
Disabling the XKB extension also avoids this problem. Uncomment the following line in your XF86Config file:
Option "XkbDisable"
xxxxx@xxxxx 2003-12-10
Key repeat can also be disabled using
xset -r
from a terminal. This doesn't require changing the X server config. Reenable with
xset r
xxxxx@xxxxx 2004-06-04
|
|
Evaluation
|
This bug is easily reproducible on RH8.0 using 1.4, 1.4.1, and 1.4.2b16 (though I had to add a delay() to the test so the JTextField was ready for input once keyPress() is called).
xxxxx@xxxxx 2003-02-12
The problem is that the keyboard repeat is kicking in just before the key is released, so the letter is being "typed" twice. I've confirmed this by reducing the Robot's auto delay (avoiding the problem) as well as increasing the delay (which causes yet more 't's to be typed). You'll either have to increase the key repeat delay on your RedHat 8.0 machine (or disable auto-repeat altogether), or decrease the amount of Robot delay used in the tests.
It is interesting, though, that even with a long auto-delay (2000ms), this problem does not appear on Solaris 9, Windows 2000, or RedHat 7.2(!). So something is going on with RedHat 8.0, presumably with the X server. This should be fixed so we can maintain cross-platform behavior. On a semi-related note, it might be useful to be able to retreive the key repeat delay and rate from the native toolkit.
xxxxx@xxxxx 2003-02-12
I just noticed that 4153069 also involved key auto-repeat, but I don't think it's related.
xxxxx@xxxxx 2003-02-12
It just occurred to me that Linux has XKB enabled by default, but Solaris
does not. XKB has options for auto-repeat behavior, so this might be one
area to investigate about the configuration difference.
http://ftp.xfree86.org/pub/XFree86/4.0.3/doc/PostScript/XKBlib.PS
xxxxx@xxxxx 2003-12-10
Good thinking. Disabling XKB on Linux also avoids this problem. I'll continue investigating to see how we can get things working with XKB enabled.
xxxxx@xxxxx 2003-12-10
The fix for this bug is to check if XKB is enabled, and ask XKB to disable key repeat when doing a Robot key event.
xxxxx@xxxxx 2004-01-05
Actually, we have been facing this problem for a long time since RH8.0 appeared.
The problem is in setting of X server. It can be retrieved using "xset -q", look for auto-repeat option.
I don't think we need to fix anything here. The increased delay for auto-repeat(which 200ms or even 150ms by default)
should be increased on every testing platform we have. Note that XKB has nothing to do with it - we get the
same problem on Solaris with Xvfb or Xnest since their default values are also too small. The problem is also in
tests - they use very long delays between keyPress and keyRelease which is wrong. We have reported this problem
to SQE and I remember they agreed to fix Tonga and other tests to reduce the delay(I think we agreed on 100ms).
xxxxx@xxxxx 2004-1-6
======================================================================
|
|
Comments
|
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |