Class Hotkey

java.lang.Object
jme3utilities.ui.Hotkey

public final class Hotkey extends Object
A named, immutable, simple trigger for actions.
  • Method Details

    • buttonCode

      public int buttonCode()
      Determine the button code of this mouse-button hotkey.
      Returns:
      a JME button code (from MouseInput) or -1 if none
    • code

      public int code()
      Determine the universal code of this hotkey.
      Returns:
      a universal code (≥0)
    • find

      public static Hotkey find(int universalCode)
      Find a hotkey by its universal code.
      Parameters:
      universalCode - a universal code: either a key code (from KeyInput) or firstMouseButton + a mouse-button code (from MouseInput) or joystick-button code (computed from a joystick index and a joystick-button index)
      Returns:
      the pre-existing instance (or null if none)
    • findButton

      public static Hotkey findButton(int buttonCode)
      Find a mouse-button hotkey by its button code.
      Parameters:
      buttonCode - a JME button code from MouseInput
      Returns:
      the pre-existing instance (or null if none)
    • findKey

      public static Hotkey findKey(int keyCode)
      Find a hotkey by its key code.
      Parameters:
      keyCode - a key code from KeyInput
      Returns:
      the pre-existing instance (or null if none)
    • findLocal

      public static Hotkey findLocal(String localName)
      Find a hotkey by its local name.
      Parameters:
      localName - a local name (not null, not empty)
      Returns:
      the pre-existing instance (or null if none)
    • findUs

      public static Hotkey findUs(String usName)
      Find a hotkey by its US name.
      Parameters:
      usName - a US name (not null, not empty)
      Returns:
      the pre-existing instance (or null if none)
    • keyCode

      public int keyCode()
      Determine the JME key code of this hotkey.
      Returns:
      a JME key code (from KeyInput) or -1 if none
    • listAll

      public static List<Hotkey> listAll()
      Enumerate all known hotkeys.
      Returns:
      a new list
    • localName

      public String localName()
      Determine the local name of this hotkey, which is the name used by BindScreen and HelpUtils.
      Returns:
      the local name (not null, not empty)
    • usName

      public String usName()
      Determine the US name of this hotkey, which is the name InputMode uses.
      Returns:
      the brief, descriptive name for this hotkey on systems with United States QWERTY keyboards (not null, not empty)