Interface IKeyMappingBinding
@NonExtendable
public interface IKeyMappingBinding
An immutable configured shortcut and its modifier requirements, including portable aliases.
Create bindings with
IKeyMappingHelper.createBinding(InputConstants.Key, Set).
Bindings are equal when their keys and both modifier sets are equal. Portable aliases remain distinct from physical modifiers.
- Since:
- 0.6.0
-
Method Summary
Modifier and TypeMethodDescriptionGet additional modifiers supplied by other mods.net.minecraft.network.chat.ComponentGet localized text for this binding, including its modifiers.com.mojang.blaze3d.platform.InputConstants.KeygetKey()Get the input assigned to this binding.Get the standard modifiers required by this binding.booleanCheck whether no keyboard key or mouse button is assigned.resolve()Resolve this binding's modifier requirements to physical inputs for the current platform.
-
Method Details
-
getKey
com.mojang.blaze3d.platform.InputConstants.Key getKey()Get the input assigned to this binding.- Returns:
- the keyboard or mouse input, or
InputConstants.UNKNOWNwhen unbound - Since:
- 0.6.0
-
getModifiers
Set<KeyMappingModifier> getModifiers()Get the standard modifiers required by this binding.- Returns:
- an immutable set of standard modifiers, or an empty set when none are required
- Since:
- 0.6.0
-
isUnbound
boolean isUnbound()Check whether no keyboard key or mouse button is assigned.- Returns:
- true when this binding is unbound
- Since:
- 0.6.0
-
resolve
IKeyMappingInput resolve()Resolve this binding's modifier requirements to physical inputs for the current platform.KeyMappingModifier.CONTROL_OR_COMMANDbecomesKeyInputModifier.COMMANDon macOS andKeyInputModifier.CONTROLelsewhere. Custom modifiers are preserved. The result does not retain whether a modifier came from an alias.- Returns:
- the input combination required by this binding on this platform
- Since:
- 0.6.0
-
getDisplayName
net.minecraft.network.chat.Component getDisplayName()Get localized text for this binding, including its modifiers.- Returns:
- the localized binding name
- Since:
- 0.6.0
-
getCustomModifiers
-