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 Type
    Method
    Description
    Get additional modifiers supplied by other mods.
    net.minecraft.network.chat.Component
    Get localized text for this binding, including its modifiers.
    com.mojang.blaze3d.platform.InputConstants.Key
    Get the input assigned to this binding.
    Get the standard modifiers required by this binding.
    boolean
    Check whether no keyboard key or mouse button is assigned.
    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.UNKNOWN when 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_COMMAND becomes KeyInputModifier.COMMAND on macOS and KeyInputModifier.CONTROL elsewhere. 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

      Set<String> getCustomModifiers()
      Get additional modifiers supplied by other mods.
      Returns:
      an immutable set of custom identifiers, or an empty set when none are required
      Since:
      0.6.0