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

[Accelerators] KeystrokeUtils should just be a function in KeyCombination

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:

      Description

      This is a code snippet from MenuItemContainer:
                      String text = KeystrokeUtils.toString(item.getAccelerator());
                      right = new Label(text);

      For me this would make more sense:
                      String text = item.getAccelerator().getDisplayText();
                      right = new Label(text);

      --------
      I need this for accessibility where I have a ACCELERATOR attribute which return the KeyCombination for the node.
      On Mac it is important to have the KeyCombination as It needs to know the modifiers, keyCode, charCode, etc.
      On Window it is just parsed to a String so it can be read by Narrator.
      Currently we using KeyCombination#toString() but that returns "Shortcut+S" instead of "Ctrl+S".
      Note that in glass we can't reference controls, so using KeystrokeUtils is not an option in WinAccessible.
      We could do our own parsing, but I rather use the 'official' one.

        Attachments

          Activity

            People

            Assignee:
            jgiles Jonathan Giles
            Reporter:
            fheidric Felipe Heidrich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: