Package net.minecraft.client.settings
Class KeyBinding
- java.lang.Object
-
- net.minecraft.client.settings.KeyBinding
-
- All Implemented Interfaces:
java.lang.Comparable<KeyBinding>
,IForgeKeybinding
- Direct Known Subclasses:
ToggleableKeyBinding
public class KeyBinding extends java.lang.Object implements java.lang.Comparable<KeyBinding>, IForgeKeybinding
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.lang.String,KeyBinding>
ALL
private static java.util.Set<java.lang.String>
CATEGORIES
private java.lang.String
category
private static java.util.Map<java.lang.String,java.lang.Integer>
CATEGORY_SORT_ORDER
private int
clickCount
private InputMappings.Input
defaultKey
(package private) boolean
isDown
private InputMappings.Input
key
private IKeyConflictContext
keyConflictContext
private KeyModifier
keyModifier
private KeyModifier
keyModifierDefault
Forge Startprivate static KeyBindingMap
MAP
private java.lang.String
name
-
Constructor Summary
Constructors Constructor Description KeyBinding(java.lang.String p_i45001_1_, int p_i45001_2_, java.lang.String p_i45001_3_)
KeyBinding(java.lang.String p_i47675_1_, InputMappings.Type p_i47675_2_, int p_i47675_3_, java.lang.String p_i47675_4_)
KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, InputMappings.Input keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext set.KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, InputMappings.Type inputType, int keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext set.KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputMappings.Input keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputMappings.Type inputType, int keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
click(InputMappings.Input p_197981_0_)
int
compareTo(KeyBinding p_compareTo_1_)
boolean
consumeClick()
static java.util.function.Supplier<ITextComponent>
createNameSupplier(java.lang.String p_193626_0_)
java.lang.String
getCategory()
InputMappings.Input
getDefaultKey()
InputMappings.Input
getKey()
IKeyConflictContext
getKeyConflictContext()
KeyModifier
getKeyModifier()
KeyModifier
getKeyModifierDefault()
java.lang.String
getName()
ITextComponent
getTranslatedKeyMessage()
boolean
isDefault()
boolean
isDown()
boolean
isUnbound()
boolean
matches(int p_197976_1_, int p_197976_2_)
boolean
matchesMouse(int p_197984_1_)
private void
release()
static void
releaseAll()
static void
resetMapping()
boolean
same(KeyBinding p_197983_1_)
java.lang.String
saveString()
static void
set(InputMappings.Input p_197980_0_, boolean p_197980_1_)
static void
setAll()
void
setDown(boolean p_225593_1_)
void
setKey(InputMappings.Input p_197979_1_)
void
setKeyConflictContext(IKeyConflictContext keyConflictContext)
void
setKeyModifierAndCode(KeyModifier keyModifier, InputMappings.Input keyCode)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.client.extensions.IForgeKeybinding
getKeyBinding, hasKeyCodeModifierConflict, isActiveAndMatches, isConflictContextAndModifierActive, setToDefault
-
-
-
-
Field Detail
-
ALL
private static final java.util.Map<java.lang.String,KeyBinding> ALL
-
MAP
private static final KeyBindingMap MAP
-
CATEGORIES
private static final java.util.Set<java.lang.String> CATEGORIES
-
CATEGORY_SORT_ORDER
private static final java.util.Map<java.lang.String,java.lang.Integer> CATEGORY_SORT_ORDER
-
name
private final java.lang.String name
-
defaultKey
private final InputMappings.Input defaultKey
-
category
private final java.lang.String category
-
key
private InputMappings.Input key
-
isDown
boolean isDown
-
clickCount
private int clickCount
-
keyModifierDefault
private KeyModifier keyModifierDefault
Forge Start
-
keyModifier
private KeyModifier keyModifier
-
keyConflictContext
private IKeyConflictContext keyConflictContext
-
-
Constructor Detail
-
KeyBinding
public KeyBinding(java.lang.String p_i45001_1_, int p_i45001_2_, java.lang.String p_i45001_3_)
-
KeyBinding
public KeyBinding(java.lang.String p_i47675_1_, InputMappings.Type p_i47675_2_, int p_i47675_3_, java.lang.String p_i47675_4_)
-
KeyBinding
public KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, InputMappings.Type inputType, int keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext set.
-
KeyBinding
public KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, InputMappings.Input keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext set.
-
KeyBinding
public KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputMappings.Type inputType, int keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.
-
KeyBinding
public KeyBinding(java.lang.String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputMappings.Input keyCode, java.lang.String category)
Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.
-
-
Method Detail
-
click
public static void click(InputMappings.Input p_197981_0_)
-
set
public static void set(InputMappings.Input p_197980_0_, boolean p_197980_1_)
-
setAll
public static void setAll()
-
releaseAll
public static void releaseAll()
-
resetMapping
public static void resetMapping()
-
isDown
public boolean isDown()
-
getCategory
public java.lang.String getCategory()
-
consumeClick
public boolean consumeClick()
-
release
private void release()
-
getName
public java.lang.String getName()
-
getDefaultKey
public InputMappings.Input getDefaultKey()
-
setKey
public void setKey(InputMappings.Input p_197979_1_)
-
compareTo
public int compareTo(KeyBinding p_compareTo_1_)
- Specified by:
compareTo
in interfacejava.lang.Comparable<KeyBinding>
-
createNameSupplier
public static java.util.function.Supplier<ITextComponent> createNameSupplier(java.lang.String p_193626_0_)
-
same
public boolean same(KeyBinding p_197983_1_)
-
isUnbound
public boolean isUnbound()
-
matches
public boolean matches(int p_197976_1_, int p_197976_2_)
-
matchesMouse
public boolean matchesMouse(int p_197984_1_)
-
getTranslatedKeyMessage
public ITextComponent getTranslatedKeyMessage()
-
isDefault
public boolean isDefault()
-
saveString
public java.lang.String saveString()
-
setDown
public void setDown(boolean p_225593_1_)
-
getKey
public InputMappings.Input getKey()
- Specified by:
getKey
in interfaceIForgeKeybinding
-
setKeyConflictContext
public void setKeyConflictContext(IKeyConflictContext keyConflictContext)
- Specified by:
setKeyConflictContext
in interfaceIForgeKeybinding
-
getKeyConflictContext
public IKeyConflictContext getKeyConflictContext()
- Specified by:
getKeyConflictContext
in interfaceIForgeKeybinding
-
getKeyModifierDefault
public KeyModifier getKeyModifierDefault()
- Specified by:
getKeyModifierDefault
in interfaceIForgeKeybinding
-
getKeyModifier
public KeyModifier getKeyModifier()
- Specified by:
getKeyModifier
in interfaceIForgeKeybinding
-
setKeyModifierAndCode
public void setKeyModifierAndCode(KeyModifier keyModifier, InputMappings.Input keyCode)
- Specified by:
setKeyModifierAndCode
in interfaceIForgeKeybinding
-
-