Enum Class KeyModifier
- All Implemented Interfaces:
Serializable,Comparable<KeyModifier>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract InputConstants.Key[]codes()static List<KeyModifier> abstract ComponentgetCombinedName(InputConstants.Key key, Supplier<Component> defaultLogic) static KeyModifierabstract booleanisActive(@Nullable IKeyConflictContext conflictContext) static booleanabstract booleanstatic KeyModifiervalueFromString(String stringValue) static KeyModifierReturns the enum constant of this class with the specified name.static KeyModifier[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTROL
Always matches the Control Key, even on OSX which normally uses the Command Key for hotkeys. Since 1.21.11, Mojang uses Control on OSX for hotkeys that conflict with OSX global system shortcuts.For hotkeys that should use the Command key on OSX (like system hotkeys ⌘C for copy, ⌘P for paste, etc.), use
CONTROL_OR_COMMANDinstead. For examples of places where Command should be used, see uses of `net.minecraft.client.input.InputWithModifiers#hasControlDownWithQuirk()`. -
CONTROL_OR_COMMAND
On Windows and Linux, this matches theControlKey. On OSX, this matches the Command Key (⌘).This is the default behavior expected by OSX players for system hotkeys (like ⌘C for copy, ⌘P for paste, etc.), and this follows the
InputQuirks.REPLACE_CTRL_KEY_WITH_CMD_KEYrule. For examples of places where Command should be used, see uses of `net.minecraft.client.input.InputWithModifiers#hasControlDownWithQuirk()`.For hotkeys that should use Control even on OSX, use
CONTROLinstead.Since 1.21.11, Mojang uses
Controlon OSX for hotkeys that conflict with OSX global system shortcuts. Use caution when setting default hotkeys with this modifier, because it's possible to end up minimizing the window or triggering some other system behavior instead of what you intended. -
SHIFT
-
ALT
-
NONE
-
-
Field Details
-
MODIFIER_VALUES
-
-
Constructor Details
-
KeyModifier
private KeyModifier()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getActiveModifiers
-
getKeyModifier
-
isKeyCodeModifier
-
valueFromString
-
matches
-
isActive
-
getCombinedName
-
codes
-