-
Bug
-
Resolution: Fixed
-
P3
-
8u152, 9, 10, 11
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8205772 | 11.0.1 | Dmitry Markov | P3 | Resolved | Fixed | team |
JDK-8208976 | 8u201 | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8205529 | 8u192 | Dmitry Markov | P3 | Resolved | Fixed | b01 |
JDK-8216878 | emb-8u201 | Dmitry Markov | P3 | Resolved | Fixed | master |
FULL PRODUCT VERSION :
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 32-bits
Windows 7 64-bits
EXTRA RELEVANT SYSTEM CONFIGURATION :
French keyboard
A DESCRIPTION OF THE PROBLEM :
Shift or Capslock stop working in java.awt.Textfield, leading to severe text input issue.
It always happens on Windows 7, either 32-bits ou 64-bits.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Send accentued keystrokes, whith keys combination like "ö ô ñ" to java.awt.Textfield
Then, Shift or Capslock, Alt Gr don't work anymore in that Textfield.
Also Control shorcuts behave incorrectly.
Character "ù" doesn't trigger the bug as it's typed on a single key, on the french keyboard.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Shifted keystrokes should be displayed in the Texfield.
ACTUAL -
It continue to works like if the Shift / Caps / Alt Gr key was not pressed, but it is.
Also shorcuts like [Control]+[key] behave differently.
For instance, Control+v pastes clipboard but also add an uneeded additionnal "v"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Frame;
import java.awt.TextField;
import java.awt.event.*;
public class TestKeysWin7 extends Frame implements WindowListener
{
MyField field;
public static void main(String args[])
{
TestKeysWin7 app = new TestKeysWin7();
}
public TestKeysWin7()
{
field = new MyField();
setVisible(true);
add(field);
setSize(800, 100);
addWindowListener(this);
}
public void windowOpened(WindowEvent e) {}
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
public void windowClosed(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowActivated(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public class MyField extends TextField implements KeyListener
{
public MyField()
{
addKeyListener(this);
}
public void keyPressed(KeyEvent e)
{
int code = e.getKeyCode();
System.out.println("Pressed key [" + KeyEvent.getKeyText(code) + "]");
}
public void keyReleased(KeyEvent e)
{
int code = e.getKeyCode();
System.out.println("Released key [" + KeyEvent.getKeyText(code) + "]");
}
public void keyTyped(KeyEvent e)
{
char ch = e.getKeyChar();
int mod = e.getModifiers();
if (mod > 0)
{
System.out.print("Typed keys [" + KeyEvent.getKeyModifiersText(mod) + "]");
System.out.print(" char [" + ch + "]");
System.out.println("");
}
else
{
System.out.println("Typed char [" + ch + "]");
}
}
}
}
---------- END SOURCE ----------
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 32-bits
Windows 7 64-bits
EXTRA RELEVANT SYSTEM CONFIGURATION :
French keyboard
A DESCRIPTION OF THE PROBLEM :
Shift or Capslock stop working in java.awt.Textfield, leading to severe text input issue.
It always happens on Windows 7, either 32-bits ou 64-bits.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Send accentued keystrokes, whith keys combination like "ö ô ñ" to java.awt.Textfield
Then, Shift or Capslock, Alt Gr don't work anymore in that Textfield.
Also Control shorcuts behave incorrectly.
Character "ù" doesn't trigger the bug as it's typed on a single key, on the french keyboard.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Shifted keystrokes should be displayed in the Texfield.
ACTUAL -
It continue to works like if the Shift / Caps / Alt Gr key was not pressed, but it is.
Also shorcuts like [Control]+[key] behave differently.
For instance, Control+v pastes clipboard but also add an uneeded additionnal "v"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Frame;
import java.awt.TextField;
import java.awt.event.*;
public class TestKeysWin7 extends Frame implements WindowListener
{
MyField field;
public static void main(String args[])
{
TestKeysWin7 app = new TestKeysWin7();
}
public TestKeysWin7()
{
field = new MyField();
setVisible(true);
add(field);
setSize(800, 100);
addWindowListener(this);
}
public void windowOpened(WindowEvent e) {}
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
public void windowClosed(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowActivated(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public class MyField extends TextField implements KeyListener
{
public MyField()
{
addKeyListener(this);
}
public void keyPressed(KeyEvent e)
{
int code = e.getKeyCode();
System.out.println("Pressed key [" + KeyEvent.getKeyText(code) + "]");
}
public void keyReleased(KeyEvent e)
{
int code = e.getKeyCode();
System.out.println("Released key [" + KeyEvent.getKeyText(code) + "]");
}
public void keyTyped(KeyEvent e)
{
char ch = e.getKeyChar();
int mod = e.getModifiers();
if (mod > 0)
{
System.out.print("Typed keys [" + KeyEvent.getKeyModifiersText(mod) + "]");
System.out.print(" char [" + ch + "]");
System.out.println("");
}
else
{
System.out.println("Typed char [" + ch + "]");
}
}
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8205529 Shift or Capslock not working in Textfield after accented keystrokes
- Resolved
-
JDK-8205772 Shift or Capslock not working in Textfield after accented keystrokes
- Resolved
-
JDK-8208976 Shift or Capslock not working in Textfield after accented keystrokes
- Resolved
-
JDK-8216878 Shift or Capslock not working in Textfield after accented keystrokes
- Resolved
- duplicates
-
JDK-8203874 Entry of e.g. $%&/()= into java.TextField not possible after ^ (DEAD_CIRCUMFLEX)
- Closed
- relates to
-
JDK-8139189 VK_OEM_102 dead key detected as VK_UNDEFINED
- Resolved
(1 relates to)