-
Bug
-
Resolution: Incomplete
-
P3
-
None
-
19
-
x86_64
-
os_x
ADDITIONAL SYSTEM INFORMATION :
Reproducible only on MacOS (currently it is 13.5.1)
With JDK19+
A DESCRIPTION OF THE PROBLEM :
Starting from JDK18 KeyEvents started to have different keycode on different keyboard layouts.
Because of that shortcuts (like copy/paste) stopped to work on non-english locales
See steps to reproduce
REGRESSION : Last worked in version 17.0.8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the application
2. Change locale to English
3. Press cmd + C
4. Change locale to Russian (may be on other it will also fail)
5. Press cmd + C
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
CODE 67 REAL CODE 67
printed on both locales
ACTUAL -
CODE 67 REAL CODE 67
is printed on English locale
CODE 67 REAL CODE 16778305
is printed on Russian locale
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class Example {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
var frame = new JFrame();
frame.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
}
@Override
public void keyPressed(KeyEvent e) {
System.out.println("CODE " + KeyEvent.VK_C + " REAL CODE " + e.getKeyCode());
}
@Override
public void keyReleased(KeyEvent e) {
}
});
frame.setSize(new Dimension(200, 200));
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
FREQUENCY : always
Reproducible only on MacOS (currently it is 13.5.1)
With JDK19+
A DESCRIPTION OF THE PROBLEM :
Starting from JDK18 KeyEvents started to have different keycode on different keyboard layouts.
Because of that shortcuts (like copy/paste) stopped to work on non-english locales
See steps to reproduce
REGRESSION : Last worked in version 17.0.8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the application
2. Change locale to English
3. Press cmd + C
4. Change locale to Russian (may be on other it will also fail)
5. Press cmd + C
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
CODE 67 REAL CODE 67
printed on both locales
ACTUAL -
CODE 67 REAL CODE 67
is printed on English locale
CODE 67 REAL CODE 16778305
is printed on Russian locale
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class Example {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
var frame = new JFrame();
frame.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
}
@Override
public void keyPressed(KeyEvent e) {
System.out.println("CODE " + KeyEvent.VK_C + " REAL CODE " + e.getKeyCode());
}
@Override
public void keyReleased(KeyEvent e) {
}
});
frame.setSize(new Dimension(200, 200));
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
FREQUENCY : always