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

Java/Swing on Windows produces incorrect key codes for "modified" dead keys

XMLWordPrintable

    • x86_64
    • windows_7

      ADDITIONAL SYSTEM INFORMATION :
      Tested with Java 8 and 11.0.4


      A DESCRIPTION OF THE PROBLEM :
      If a dead key produces a different diacritic when modified by Shift or AltGr, Swing usually reports the key code for the unmodified dead key rather than the modified dead key (but sometimes it reports another incorrect key code.) Specifically:

      (NOTE: keystroke in parentheses indicates the equivalent keystroke on a U.S. keyboard.)

      French keyboard layout:
      Dead Diaeresis (Shift [) produces VK_DEAD_CIRCUMFLEX.

      German keyboard layout:
      Dead Grave (Shift =) produces VK_DEAD_ACUTE.

      Spanish keyboard layout:
      Dead Circumflex (Shift [) produces VK_DEAD_GRAVE.
      Dead Diaeresis (Shift ') produces VK_DEAD_ACUTE.

      U.S. International keyboard layout:
      Dead Tilde (Shift ` produces VK_DEAD_GRAVE.
      Dead Diaeresis (Shift ') produces VK_DEAD_ACUTE.

      Croatian keyboard layout:
      Dead Diaeresis (Shift `) produces VK_DEAD_CEDILLA.
      Dead Overring (RAlt 5) produces VK_5.

      Canadian Multilingual keyboard layout:
      Dead Diaeresis (Shift [) produces VK_DEAD_CIRCUMFLEX.
      Dead Grave (RAlt [) produces VK_DEAD_CIRCUMFLEX.
      Dead Overring (RCtrl Shift [) produces VK_DEAD_CIRCUMFLEX.
      Dead Above Dot (RCtrl .) produces VK_PERIOD.
      Dead Above Dot (RCtrl Shift /) produces a key code of 0.

      Swedish keyboard layout:
      Dead Grave (Shift =) produces VK_DEAD_ACUTE.
      Dead Circumflex (Shift ]) produces VK_DEAD_DIAERESIS.
      Dead Tilde (RAlt ]) produces VK_DEAD_DIAERESIS.

      Greek keyboard layout:
      Dead Acute (;) produces a key code of 0.
      Dead Diaeresis (Shift ;) produces a key code of 0.
      Dead Acute+Diaeresis (AltGr ;) produces a key code of 0.
      Dead Acute+Diaeresis (Shift W) produces VK_W.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See description.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      See description.
      ACTUAL -
      See description.

      FREQUENCY : always


            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: