java.lang.Object
net.minecraft.client.KeyMapping
io.github.startsmercury.simply_no_shading.impl.client.KeyMapping
All Implemented Interfaces:
Comparable<net.minecraft.client.KeyMapping>

public class KeyMapping extends net.minecraft.client.KeyMapping
A Minecraft key mapping with extended functionality.

This extension supports differentiating and consuming instantaneous press and release events.

Since:
6.2.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected boolean
     

    Fields inherited from class net.minecraft.client.KeyMapping

    CATEGORY_CREATIVE, CATEGORY_GAMEPLAY, CATEGORY_INTERFACE, CATEGORY_INVENTORY, CATEGORY_MISC, CATEGORY_MOVEMENT, CATEGORY_MULTIPLAYER
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeyMapping(String name, int key, String category)
    Creates a new key mapping.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Detects a press and clears this state.
    boolean
    Detects a release and clears this state.
    void
    setDown(boolean down)
     

    Methods inherited from class net.minecraft.client.KeyMapping

    click, compareTo, consumeClick, createNameSupplier, getCategory, getDefaultKey, getName, getTranslatedKeyMessage, isDefault, isDown, isUnbound, matches, matchesMouse, releaseAll, resetMapping, resetToggleKeys, same, saveString, set, setAll, setKey

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • pressed

      protected boolean pressed
    • released

      protected boolean released
  • Constructor Details

    • KeyMapping

      public KeyMapping(String name, int key, String category)
      Creates a new key mapping.
  • Method Details

    • consumePressed

      public boolean consumePressed()
      Detects a press and clears this state.
      Returns:
      true if this was pressed
    • consumeReleased

      public boolean consumeReleased()
      Detects a release and clears this state.
      Returns:
      true if this was released
    • setDown

      public void setDown(boolean down)
      Overrides:
      setDown in class net.minecraft.client.KeyMapping