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

DEAD_ACUTE + c generates c-acute instead of c-cedilla on Win US Intl layout

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx11, 8u20, jfx23
    • javafx
    • None

      On a Windows US International keyboard layout DEAD_ACUTE + c should yield ç but instead yields a c with an acute accent. This combination is an exception, in most cases DEAD_ACUTE should yield a character with an acute accent. But not this particular combination on this particular layout.

      This cannot be easily fixed until the minimum system requirement is upped to Windows 10 version 1607.

      While processing a key press the glass code needs to come up with a value for the ‘text’ field in the KeyEvent. The text field is used for mnemonic processing. Due to surprising limitations in the Windows API the calls that map virtual key codes to text also clear the dead key state from the keyboard. Since this state is lost glass has to try to replicate dead key processing itself. It does so in a generic way which doesn’t capture special cases like this one.

      Glass does contain some code which detects certain layouts (Greek and Latvian) and tries to replicate their behavior. But the way it identifies these layouts is undocumented; the information is encoded in the HIWORD of the HKL but Microsoft doesn’t document those values or guarantee that they are stable. With that said looking at the HIWORD of the HKL is how everybody does it so it seems unlikely that Microsoft would alter how this works.

      In theory we could extend the existing logic to cover this case. A cleaner solution is to wait until the minimum system requirement is Windows 10 version 1607. That’s the point where Microsoft finally provided an API to do the key-to-text conversion without upsetting the dead key state. We should be able to switch to the new API and remove all the dead key processing from glass.

      To reproduce, install the Windows US International keyboard layout. On Windows 11 the current way of doing this (which will probably change in a few months to make it even more cumbersome) is:

      Go to Settings > Time & language > Language & region. Click on the three dots to the far right of the English entry and select “Language options”. Scroll down until you find “Add a keyboard”. From that button scroll through all the many, many layouts until you find “United States-International”. Once you’ve added the keyboard you should see a button on the far right of the task bar to select the layout (it will have the word “ENG” in it). The DEAD_ACUTE key is where the single quote key is on the standard US keyboard.

            mfox Martin Fox
            mfox Martin Fox
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: