public class KeyBinding extends java.lang.Object implements java.lang.Comparable<KeyBinding>
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.String,java.lang.Integer> |
CATEGORY_ORDER |
private static KeyBindingMap |
HASH |
private static java.util.Map<java.lang.String,KeyBinding> |
KEYBIND_ARRAY |
private static java.util.Set<java.lang.String> |
KEYBIND_SET |
private java.lang.String |
keyCategory |
private int |
keyCode |
private int |
keyCodeDefault |
private IKeyConflictContext |
keyConflictContext |
private java.lang.String |
keyDescription |
private KeyModifier |
keyModifier |
private KeyModifier |
keyModifierDefault
Forge Start
|
private boolean |
pressed |
private int |
pressTime |
Constructor and Description |
---|
KeyBinding(java.lang.String description,
IKeyConflictContext keyConflictContext,
int keyCode,
java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext set.
|
KeyBinding(java.lang.String description,
IKeyConflictContext keyConflictContext,
KeyModifier keyModifier,
int keyCode,
java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.
|
KeyBinding(java.lang.String description,
int keyCode,
java.lang.String category) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(KeyBinding p_compareTo_1_) |
boolean |
conflicts(KeyBinding other)
Returns true when the other keyBinding conflicts with this one
|
java.lang.String |
getDisplayName() |
static java.util.function.Supplier<java.lang.String> |
getDisplayString(java.lang.String key)
Forge End
|
static java.util.Set<java.lang.String> |
getKeybinds() |
java.lang.String |
getKeyCategory() |
int |
getKeyCode() |
int |
getKeyCodeDefault() |
IKeyConflictContext |
getKeyConflictContext() |
java.lang.String |
getKeyDescription() |
KeyModifier |
getKeyModifier() |
KeyModifier |
getKeyModifierDefault() |
boolean |
hasKeyCodeModifierConflict(KeyBinding other)
Returns true when one of the bindings' key codes conflicts with the other's modifier.
|
boolean |
isActiveAndMatches(int keyCode)
Checks that the key conflict context and modifier are active, and that the keyCode matches this binding.
|
boolean |
isKeyDown() |
boolean |
isPressed() |
boolean |
isSetToDefaultValue() |
static void |
onTick(int keyCode) |
static void |
resetKeyBindingArrayAndHash() |
static void |
setKeyBindState(int keyCode,
boolean pressed) |
void |
setKeyCode(int keyCode) |
void |
setKeyConflictContext(IKeyConflictContext keyConflictContext) |
void |
setKeyModifierAndCode(KeyModifier keyModifier,
int keyCode) |
void |
setToDefault() |
static void |
unPressAllKeys() |
private void |
unpressKey() |
static void |
updateKeyBindState() |
private static final java.util.Map<java.lang.String,KeyBinding> KEYBIND_ARRAY
private static final KeyBindingMap HASH
private static final java.util.Set<java.lang.String> KEYBIND_SET
private static final java.util.Map<java.lang.String,java.lang.Integer> CATEGORY_ORDER
private final java.lang.String keyDescription
private final int keyCodeDefault
private final java.lang.String keyCategory
private int keyCode
private boolean pressed
private int pressTime
private KeyModifier keyModifierDefault
private KeyModifier keyModifier
private IKeyConflictContext keyConflictContext
public KeyBinding(java.lang.String description, int keyCode, java.lang.String category)
public KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, int keyCode, java.lang.String category)
public KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, int keyCode, java.lang.String category)
public static void onTick(int keyCode)
public static void setKeyBindState(int keyCode, boolean pressed)
public static void updateKeyBindState()
public static void unPressAllKeys()
public static void resetKeyBindingArrayAndHash()
public static java.util.Set<java.lang.String> getKeybinds()
public boolean isKeyDown()
public java.lang.String getKeyCategory()
public boolean isPressed()
private void unpressKey()
public java.lang.String getKeyDescription()
public int getKeyCodeDefault()
public int getKeyCode()
public void setKeyCode(int keyCode)
public int compareTo(KeyBinding p_compareTo_1_)
compareTo
in interface java.lang.Comparable<KeyBinding>
public boolean isActiveAndMatches(int keyCode)
public void setKeyConflictContext(IKeyConflictContext keyConflictContext)
public IKeyConflictContext getKeyConflictContext()
public KeyModifier getKeyModifierDefault()
public KeyModifier getKeyModifier()
public void setKeyModifierAndCode(KeyModifier keyModifier, int keyCode)
public void setToDefault()
public boolean isSetToDefaultValue()
public boolean conflicts(KeyBinding other)
public boolean hasKeyCodeModifierConflict(KeyBinding other)
public java.lang.String getDisplayName()
public static java.util.function.Supplier<java.lang.String> getDisplayString(java.lang.String key)