Package net.minecraft.client.option
Class KeyBinding
java.lang.Object
net.minecraft.client.option.KeyBinding
- All Implemented Interfaces:
Comparable<KeyBinding>
- Direct Known Subclasses:
StickyKeyBinding
@Environment(CLIENT) public class KeyBinding extends Object implements Comparable<KeyBinding>
-
Field Summary
Fields Modifier and Type Field Description private InputUtil.KeyboundKeyprivate Stringcategoryprivate static Map<String,Integer>categoryOrderMapprivate InputUtil.KeydefaultKeyprivate static Set<String>keyCategoriesprivate static Map<String,KeyBinding>keysByIdprivate static Map<InputUtil.Key,KeyBinding>keyToBindingsprivate booleanpressedprivate inttimesPressedprivate StringtranslationKey -
Constructor Summary
Constructors Constructor Description KeyBinding(String translationKey, int code, String category)KeyBinding(String translationKey, InputUtil.Type type, int code, String category) -
Method Summary
Modifier and Type Method Description intcompareTo(KeyBinding keyBinding)booleanequals(KeyBinding other)TextgetBoundKeyLocalizedText()StringgetBoundKeyTranslationKey()StringgetCategory()InputUtil.KeygetDefaultKey()static Supplier<Text>getLocalizedName(String id)StringgetTranslationKey()booleanisDefault()booleanisPressed()booleanisUnbound()booleanmatchesKey(int keyCode, int scanCode)booleanmatchesMouse(int code)static voidonKeyPressed(InputUtil.Key key)private voidreset()voidsetBoundKey(InputUtil.Key boundKey)static voidsetKeyPressed(InputUtil.Key key, boolean pressed)voidsetPressed(boolean pressed)static voidunpressAll()static voidupdateKeysByCode()static voidupdatePressedStates()booleanwasPressed()
-
Field Details
-
keysById
-
keyToBindings
-
keyCategories
-
categoryOrderMap
-
translationKey
-
defaultKey
-
category
-
boundKey
-
pressed
private boolean pressed -
timesPressed
private int timesPressed
-
-
Constructor Details
-
KeyBinding
-
KeyBinding
-
-
Method Details
-
onKeyPressed
-
setKeyPressed
-
updatePressedStates
public static void updatePressedStates() -
unpressAll
public static void unpressAll() -
updateKeysByCode
public static void updateKeysByCode() -
isPressed
public boolean isPressed() -
getCategory
-
wasPressed
public boolean wasPressed() -
reset
private void reset() -
getTranslationKey
-
getDefaultKey
-
setBoundKey
-
compareTo
- Specified by:
compareToin interfaceComparable<KeyBinding>
-
getLocalizedName
-
equals
-
isUnbound
public boolean isUnbound() -
matchesKey
public boolean matchesKey(int keyCode, int scanCode) -
matchesMouse
public boolean matchesMouse(int code) -
getBoundKeyLocalizedText
-
isDefault
public boolean isDefault() -
getBoundKeyTranslationKey
-
setPressed
public void setPressed(boolean pressed)
-