Interface IKeyMappingInput


@NonExtendable public interface IKeyMappingInput
An immutable combination of a keyboard or mouse input and physical modifiers. Represents captured input or a binding resolved for the current platform.

Inputs are equal when their keys and both modifier sets are equal.

Since:
0.6.0
  • Method Details

    • getKey

      com.mojang.blaze3d.platform.InputConstants.Key getKey()
      Get the main keyboard or mouse input.
      Returns:
      the input, or InputConstants.UNKNOWN when resolving an unbound binding
      Since:
      0.6.0
    • getModifiers

      Set<KeyInputModifier> getModifiers()
      Get the physical standard modifiers in this combination.
      Returns:
      an immutable set of modifiers, or an empty set when none are present
      Since:
      0.6.0
    • toBinding

      IKeyMappingBinding toBinding()
      Create a binding requiring this input's physical modifiers. All standard and custom modifiers are preserved.
      Returns:
      a binding with physical modifier requirements
      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 present
      Since:
      0.6.0
    • withCustomModifiers

      IKeyMappingInput withCustomModifiers(Set<String> customModifiers)
      Create an input combination with the same key and standard modifiers and different custom modifiers. An unknown input has no modifiers.
      Parameters:
      customModifiers - replacement identifiers matching [a-z0-9_.:/-]+, excluding standard modifier names and none
      Returns:
      an immutable input snapshot
      Throws:
      IllegalArgumentException - if a custom identifier is invalid or reserved
      Since:
      0.6.0