-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
x86
-
windows_2000
Name: rmT116609 Date: 06/26/2002
FULL PRODUCT VERSION :
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195], SP2
EXTRA RELEVANT SYSTEM CONFIGURATION :
Czech locale
A DESCRIPTION OF THE PROBLEM :
There are extra KEY_TYPED keyevent generated after both
KEY_RELEASED events in case Alt+Left is pressed (and many
others). This extra KEY_TYPED is not generated on 1.3.1.
Although I have nothing against generation of the KEY_TYPED
event it must have the Alt modifier filled in properly
otherwise the filtering in defaultKeyTypedAction in the
editor kit will not filter out that KEY_TYPED event and the
text will get inserted into the document. This makes the
Alt+Left shortcut and many others unusable on 1.4. I think
this already happen in past on 1.2 or 1.1 so I've marked
this bug as regression.
REGRESSION. Last worked in version 1.3.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run attached app with JEditorPane on W2k
2. Press Alt then Cursor-left and then release both keys
3. Comma will appear in the JEditorPane's document which is wrong IMHO.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Console Output on 1.4:
KEY_PRESSED,keyCode=18,keyChar='?',modifiers=Alt,extModifiers=Alt,keyLocation=KEY_LOCATION_LEFT
---------------------------------
KEY_PRESSED,keyCode=37,Left,modifiers=Alt,extModifiers=Alt,keyLocation=KEY_LOCATION_STANDARD
---------------------------------
KEY_RELEASED,keyCode=37,Left,modifiers=Alt,extModifiers=Alt,keyLocation=KEY_LOCATION_STANDARD
---------------------------------
KEY_RELEASED,keyCode=18,keyChar='?',keyLocation=KEY_LOCATION_LEFT
---------------------------------
KEY_TYPED,keyCode=0,keyChar=',',keyLocation=KEY_LOCATION_UNKNOWN
---------------------------------
Console output on 1.3.1:
KEY_PRESSED,keyCode=18,keyChar='?',modifiers=Alt
---------------------------------
KEY_PRESSED,keyCode=37,Left,modifiers=Alt
---------------------------------
KEY_RELEASED,keyCode=37,Left,modifiers=Alt
---------------------------------
KEY_RELEASED,keyCode=18,keyChar='?'
---------------------------------
REPRODUCIBILITY :
This bug can be reproduced always.
The problem is also reproducible on Windows 2000 using 1.4.1-beta.
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class KeyEventTest {
public static void main(String args[]) {
JEditorPane pane = new JEditorPane();
JFrame f = new JFrame();
f.addWindowListener (new WindowAdapter () {
public void windowClosing (WindowEvent evt) {
System.exit(0);
}
});
f.getContentPane().add(new JScrollPane(pane));
f.setSize(500, 500);
f.setVisible(true);
// Key listener that debugs the key events
// being sent to the pane
pane.addKeyListener(
new KeyListener() {
public void keyPressed(KeyEvent e) {
debugKeyEvent(e);
}
public void keyReleased(KeyEvent e) {
debugKeyEvent(e);
}
public void keyTyped(KeyEvent e) {
debugKeyEvent(e);
}
}
);
}
private static void debugKeyEvent(KeyEvent e) {
System.err.println(e.paramString());
System.err.println("---------------------------------");
}
}
---------- END SOURCE ----------
Release Regression From : 1.3.1_03
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 158480)
======================================================================
- duplicates
-
JDK-4737679 Alt+Left/right/up/down generate characters in JTextArea
-
- Resolved
-
- relates to
-
JDK-4710498 KeyBind Ctrl+BackSpace does not function correctly with IME
-
- Closed
-
-
JDK-4501485 Alt-arrow keys enters strange characters in TextComponents
-
- Closed
-