Other | Other |
---|---|
1.1.8 1.1.8Fixed | 1.2.2Fixed |
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
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
|