Class Accelerator


  • public class Accelerator
    extends Object
    A keyboard shortcut, consisting of a KeyCode plus InputModifiers.
    Author:
    Curtis Rueden, Barry DeZonia
    • Method Detail

      • getKeyCode

        public KeyCode getKeyCode()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • create

        public static Accelerator create​(String acc)
        Creates an accelerator from the given string representation. The string must have the following syntax:
                    <modifiers>* <keyCode>
         
                    modifiers := alt | altGraph | control | meta | shift
                    keyCode := KeyCode field (e.g., COMMA or UP)
         
        For convenience:
        • "control" may be shortened to "ctrl"
        • "altGraph" may be shortened to "altGr"
        • The caret character ('^') is expanded to "control " on non-Mac platforms, and "meta " (i.e., the Mac command key) on Mac platforms.
        Here are some example strings:
        • "INSERT"
        • "control DELETE"
        • "alt shift X"
        • "^C"
        See Also:
        for the syntax from which this one is derived., for the complete list of special character codes.
      • isCtrlReplacedWithMeta

        public static boolean isCtrlReplacedWithMeta()