All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement

public class KeyBindsScreen extends OptionsSubScreen
  • Field Details

    • TITLE

      private static final Component TITLE
    • selectedKey

      @Nullable public KeyMapping selectedKey
    • lastKeySelection

      public long lastKeySelection
    • keyBindsList

      private KeyBindsList keyBindsList
    • resetButton

      private Button resetButton
    • lastPressedKey

      private InputConstants.Key lastPressedKey
    • lastPressedModifier

      private InputConstants.Key lastPressedModifier
    • isLastKeyHeldDown

      private boolean isLastKeyHeldDown
    • isLastModifierHeldDown

      private boolean isLastModifierHeldDown
  • Constructor Details

    • KeyBindsScreen

      public KeyBindsScreen(Screen pLastScreen, Options pOptions)
  • Method Details

    • addContents

      protected void addContents()
      Overrides:
      addContents in class OptionsSubScreen
    • addOptions

      protected void addOptions()
      Specified by:
      addOptions in class OptionsSubScreen
    • addFooter

      protected void addFooter()
      Overrides:
      addFooter in class OptionsSubScreen
    • repositionElements

      protected void repositionElements()
      Overrides:
      repositionElements in class OptionsSubScreen
    • mouseClicked

      public boolean mouseClicked(double pMouseX, double pMouseY, int pButton)
      Called when a mouse button is clicked within the GUI element.

      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • keyPressed

      public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • keyReleased

      public boolean keyReleased(int p_94715_, int p_94716_, int p_94717_)
      Description copied from interface: ContainerEventHandler
      Called when a keyboard key is released within the GUI element.

      Parameters:
      p_94715_ - the key code of the released key.
      p_94716_ - the scan code of the released key.
      p_94717_ - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • render

      public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
      Parameters:
      pGuiGraphics - the GuiGraphics object used for rendering.
      pMouseX - the x-coordinate of the mouse cursor.
      pMouseY - the y-coordinate of the mouse cursor.
      pPartialTick - the partial tick time.