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

[Win] Robot can target wrong key for punctuation and symbols

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx21
    • jfx11, jfx17
    • javafx
    • None

      The Windows Robot can target the wrong key when trying to generate a keyPress if the KeyCode specifies punctuation or a symbol. Internally it incorrectly uses a table which assumes a fixed relationship between the OEM keys and the characters they generate.

      Your mileage my vary. On my US QWERTY keyboard a Robot will target the wrong key for back quote, back slash, and quote.

      The table is also missing entries for KeyCodes that aren't present on US layouts, like KeyCode.PLUS. Any attempt to send KeyCode.PLUS with the Robot will always be a no-op even on layouts where KeyCode.PLUS is present (like German).

      To reproduce:
      Install a German keyboard layout
      Make the German layout active
      Run the included test application
      Press the '+' key (on a German keyboard that is at the same location as right bracket on a US keyboard)

      Result:
      The test fails with this message:
      * Failed: sent Plus but did not receive event

      Expected:
      The test should pass with the message:
      Passed: sent code Plus and received it back

      Alternatively run the included test app and type punctuation and symbol keys on the keyboard. Avoid dead keys as they can confuse the test.

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

              Created:
              Updated:
              Resolved: