Package net.minecraft.client
Class KeyMapping
java.lang.Object
net.minecraft.client.KeyMapping
- All Implemented Interfaces:
Comparable<KeyMapping>
,IKeyMappingExtension
- Direct Known Subclasses:
ToggleKeyMapping
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Map
<String, KeyMapping> private final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
private int
private final InputConstants.Key
(package private) boolean
private InputConstants.Key
private IKeyConflictContext
private KeyModifier
private KeyModifier
Forge Startprivate static final KeyMappingLookup
private final String
-
Constructor Summary
ConstructorDescriptionKeyMapping
(String p_90821_, int p_90822_, String p_90823_) KeyMapping
(String p_90825_, InputConstants.Type p_90826_, int p_90827_, String p_90828_) KeyMapping
(String description, IKeyConflictContext keyConflictContext, InputConstants.Key keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext set.KeyMapping
(String description, IKeyConflictContext keyConflictContext, InputConstants.Type inputType, int keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext set.KeyMapping
(String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputConstants.Key keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.KeyMapping
(String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputConstants.Type inputType, int keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
click
(InputConstants.Key p_90836_) int
compareTo
(KeyMapping p_90841_) boolean
createNameSupplier
(String p_90843_) getKey()
getName()
boolean
boolean
isDown()
boolean
boolean
matches
(int p_90833_, int p_90834_) boolean
matchesMouse
(int p_90831_) private void
release()
static void
static void
static void
boolean
same
(KeyMapping p_90851_) static void
set
(InputConstants.Key p_90838_, boolean p_90839_) static void
setAll()
void
setDown
(boolean p_90846_) void
setKey
(InputConstants.Key p_90849_) void
setKeyConflictContext
(IKeyConflictContext keyConflictContext) void
setKeyModifierAndCode
(KeyModifier keyModifier, InputConstants.Key keyCode) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.extensions.IKeyMappingExtension
hasKeyModifierConflict, isActiveAndMatches, isConflictContextAndModifierActive, setToDefault
-
Field Details
-
ALL
-
MAP
-
CATEGORIES
-
CATEGORY_MOVEMENT
- See Also:
-
CATEGORY_MISC
- See Also:
-
CATEGORY_MULTIPLAYER
- See Also:
-
CATEGORY_GAMEPLAY
- See Also:
-
CATEGORY_INVENTORY
- See Also:
-
CATEGORY_INTERFACE
- See Also:
-
CATEGORY_CREATIVE
- See Also:
-
CATEGORY_SORT_ORDER
-
name
-
defaultKey
-
category
-
key
-
isDown
boolean isDown -
clickCount
private int clickCount -
keyModifierDefault
Forge Start -
keyModifier
-
keyConflictContext
-
-
Constructor Details
-
KeyMapping
-
KeyMapping
-
KeyMapping
public KeyMapping(String description, IKeyConflictContext keyConflictContext, InputConstants.Type inputType, int keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext set. -
KeyMapping
public KeyMapping(String description, IKeyConflictContext keyConflictContext, InputConstants.Key keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext set. -
KeyMapping
public KeyMapping(String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputConstants.Type inputType, int keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set. -
KeyMapping
public KeyMapping(String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, InputConstants.Key keyCode, String category) Convenience constructor for creating KeyBindings with keyConflictContext and keyModifier set.
-
-
Method Details
-
click
-
set
-
setAll
public static void setAll() -
releaseAll
public static void releaseAll() -
resetToggleKeys
public static void resetToggleKeys() -
resetMapping
public static void resetMapping() -
isDown
public boolean isDown() -
getCategory
-
consumeClick
public boolean consumeClick() -
release
private void release() -
getName
-
getDefaultKey
-
setKey
-
compareTo
- Specified by:
compareTo
in interfaceComparable<KeyMapping>
-
createNameSupplier
-
same
-
isUnbound
public boolean isUnbound() -
matches
public boolean matches(int p_90833_, int p_90834_) -
matchesMouse
public boolean matchesMouse(int p_90831_) -
getTranslatedKeyMessage
-
isDefault
public boolean isDefault() -
saveString
-
setDown
public void setDown(boolean p_90846_) -
getKey
- Specified by:
getKey
in interfaceIKeyMappingExtension
-
setKeyConflictContext
- Specified by:
setKeyConflictContext
in interfaceIKeyMappingExtension
-
getKeyConflictContext
- Specified by:
getKeyConflictContext
in interfaceIKeyMappingExtension
-
getDefaultKeyModifier
- Specified by:
getDefaultKeyModifier
in interfaceIKeyMappingExtension
-
getKeyModifier
- Specified by:
getKeyModifier
in interfaceIKeyMappingExtension
-
setKeyModifierAndCode
- Specified by:
setKeyModifierAndCode
in interfaceIKeyMappingExtension
-