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

[macos] Wrong characters typed when moving the cursor with mouse after typing dead key

XMLWordPrintable

    • x86
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      macOS 10.15.3
      OpenJDK 14+36-1461

      A DESCRIPTION OF THE PROBLEM :
      When typing a backtick (dead key) and then moving a cursor, a backtick wrongly appears at the same place where the cursor was moved, whereas it should have remained where it was typed.

      It’s important to move the cursor with the mouse, because the problem doesn’t happen when moving with the keyboard.

      After moving the caret, the dead key turns into a simple backtick which is fine, however in OpenJDK it jumps to the place where the cursor was moved, that contradicts the default behavior in all basic applications on macOS.

      On Windows 10 and Ubuntu 18.04, the behavior in OpenJDK matches the default system behavior. The corresponding investigation is available here: https://youtrack.jetbrains.com/issue/IDEA-235722#focus=streamItem-27-4028417.0-0

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Go to "System Preferences -> Keyboard -> Input Sources" and add "Finnish".
      2. Compile and run the test case, whose code is provided below.
      3. Type "foo" and place the cursor at the beginning of the word:
      <caret>foo
      4. Press "`" (on U.S. keyboard layout it is the [+] button just before the [delete] button), and then click at the end of the word:
      foo<click here>


      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      public class JTextAreaTest {
          public static void main(String[] args) {
              SwingUtilities.invokeLater(() -> {
                  JFrame frame = new JFrame(“Input bug”);
                  frame.getContentPane().add(new JTextArea(20, 60));
                  frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                  frame.pack();
                  frame.setLocationRelativeTo(null);
                  frame.setVisible(true);
              });
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Press "Space" or "Esc" before moving the cursor, to turn the dead key into a simple backtick

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: