-
Bug
-
Resolution: Fixed
-
P3
-
1.1.8
-
1.1.8
-
generic
-
generic, windows_nt
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2025067 | 1.2.2 | Uwe Uwe | P3 | Resolved | Fixed | 1.2.2 |
This is a regression introduced in win32 JDK 1.1.8 build F. The test case works fine on WinNT using 1.1.8 build E and 1.1.7B. As far as I can tell, the test does not pass on Solaris for any 1.1 version of the JDK (see e.g. 4174399).
import java.awt.*;
import java.awt.event.*;
public class ModifierTest extends Frame implements KeyListener {
public static void main(String args[]) {
new ModifierTest();
}
public ModifierTest() {
TextArea ta = new TextArea(8, 30);
ta.addKeyListener(this);
add(ta);
pack();
show();
}
public void keyPressed(KeyEvent evt) { }
public void keyReleased(KeyEvent e) { }
public void keyTyped(KeyEvent evt) {
char keyChar = evt.getKeyChar();
System.out.println("Key event = " + evt);
System.out.println("Key mods = " + KeyEvent.getKeyModifiersText(evt.get
Modifiers()));
if ( evt.isShiftDown() ) {
System.out.println("Shift key is down");
}
if ( evt.isControlDown()) {
System.out.println("Control key is down");
}
if ( evt.isAltDown() ) {
System.out.println("Alt key is down");
}
if ( evt.isMetaDown() ) {
System.out.println("Meta key is down");
}
}
}
Example output from WinNT 4.0 SP3 when pressing Shift-A:
D:\KeyTest\reg>C:\jdk118F-bin\jdk1.1.8\bin\java -classpath C:\jdk118F-bin\jdk1.1
.8\lib\classes.zip;. ModifierTest
Key event = java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyChar='A'] on text0
Key mods =
D:\KeyTest\reg>C:\jdk118E-bin\jdk1.1.8\bin\java -classpath C:\jdk118E-bin\jdk1.1
.8\lib\classes.zip;. ModifierTest
Key event = java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyChar='A',modifiers=Sh
ift] on text0
Key mods = Shift
Shift key is down
stuart.lawrence@eng 1999-02-08
import java.awt.*;
import java.awt.event.*;
public class ModifierTest extends Frame implements KeyListener {
public static void main(String args[]) {
new ModifierTest();
}
public ModifierTest() {
TextArea ta = new TextArea(8, 30);
ta.addKeyListener(this);
add(ta);
pack();
show();
}
public void keyPressed(KeyEvent evt) { }
public void keyReleased(KeyEvent e) { }
public void keyTyped(KeyEvent evt) {
char keyChar = evt.getKeyChar();
System.out.println("Key event = " + evt);
System.out.println("Key mods = " + KeyEvent.getKeyModifiersText(evt.get
Modifiers()));
if ( evt.isShiftDown() ) {
System.out.println("Shift key is down");
}
if ( evt.isControlDown()) {
System.out.println("Control key is down");
}
if ( evt.isAltDown() ) {
System.out.println("Alt key is down");
}
if ( evt.isMetaDown() ) {
System.out.println("Meta key is down");
}
}
}
Example output from WinNT 4.0 SP3 when pressing Shift-A:
D:\KeyTest\reg>C:\jdk118F-bin\jdk1.1.8\bin\java -classpath C:\jdk118F-bin\jdk1.1
.8\lib\classes.zip;. ModifierTest
Key event = java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyChar='A'] on text0
Key mods =
D:\KeyTest\reg>C:\jdk118E-bin\jdk1.1.8\bin\java -classpath C:\jdk118E-bin\jdk1.1
.8\lib\classes.zip;. ModifierTest
Key event = java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyChar='A',modifiers=Sh
ift] on text0
Key mods = Shift
Shift key is down
stuart.lawrence@eng 1999-02-08
- backported by
-
JDK-2025067 Modifiers not set for KEY_TYPED events on win32
- Resolved
- duplicates
-
JDK-4218580 KeyEvent modifiers not sent for KEY_TYPED events on Solaris
- Closed
- relates to
-
JDK-4174399 KeyEvent modifiers not working on unix platforms
- Closed
-
JDK-4182178 "isControlDown" doesn't work.
- Closed
-
JDK-4220772 Key modifiers not passed for KEY_TYPED events on Solaris
- Closed
-
JDK-4220304 Alt-Graph + key fail to display euro or any other symbol on 2.5.1 OpenWin.
- Closed
(1 relates to)