public class KeyBinding extends java.lang.Object implements java.lang.Comparable<KeyBinding>
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() |
static void |
updateKeyBindState() |
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()
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)