Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8169355

Diacritics input works incorrectly on Windows if Spanish (Latin American) keyboard layout is used

    Details

    • Subcomponent:
    • Resolved In Build:
      b147
    • OS:
      windows

      Backports

        Description

        The issue can be reproduced using a simple program (see below):

        import javax.swing.*;
        import java.awt.event.KeyAdapter;
        import java.awt.event.KeyEvent;
        import java.util.concurrent.locks.LockSupport;

        public class JTextFieldWithDelayTest {
            public static void main(String[] args) {
                SwingUtilities.invokeLater(() -> {
                    JFrame frame = new JFrame();
                    JTextField textField = new JTextField(20);
                    textField.addKeyListener(new KeyAdapter() {
                        @Override
                        public void keyTyped(KeyEvent e) {
                            LockSupport.parkNanos(1_000_000_000L);
                        }
                    });
                    frame.add(textField);
                    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
                });
            }
        }

        After launching the program, perform the following steps:
        1) Switch to 'Spanish (United States)' input method (with 'Latin American' keyboard layout)
        2) Type the following in a text field: ' ' o - i.e. single quote two times (using [ key on US keyboard) then o character.

        Expected result is ''o.
        Actual result is ''ó.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dmarkov Dmitry Markov
                  Reporter:
                  dmarkov Dmitry Markov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: