Package jme3utilities.ui
Class Hotkey
java.lang.Object
jme3utilities.ui.Hotkey
A named, immutable, simple trigger for actions.
-
Method Summary
Modifier and TypeMethodDescriptionint
Determine the button code of this mouse-button hotkey.int
code()
Determine the universal code of this hotkey.static Hotkey
find
(int universalCode) Find a hotkey by its universal code.static Hotkey
findButton
(int buttonCode) Find a mouse-button hotkey by its button code.static Hotkey
findKey
(int keyCode) Find a hotkey by its key code.static Hotkey
Find a hotkey by its local name.static Hotkey
Find a hotkey by its US name.int
keyCode()
Determine the JME key code of this hotkey.listAll()
Enumerate all known hotkeys.Determine the local name of this hotkey, which is the name used by BindScreen and HelpUtils.usName()
Determine the US name of this hotkey, which is the name InputMode uses.
-
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
Find a hotkey by its universal code.- Parameters:
universalCode
- a universal code: either a key code (fromKeyInput
) or firstMouseButton + a mouse-button code (fromMouseInput
) or joystick-button code (computed from a joystick index and a joystick-button index)- Returns:
- the pre-existing instance (or null if none)
-
findButton
Find a mouse-button hotkey by its button code.- Parameters:
buttonCode
- a JME button code fromMouseInput
- Returns:
- the pre-existing instance (or null if none)
-
findKey
Find a hotkey by its key code.- Parameters:
keyCode
- a key code fromKeyInput
- Returns:
- the pre-existing instance (or null if none)
-
findLocal
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
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
Enumerate all known hotkeys.- Returns:
- a new list
-
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
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)
-