Interface ClientScreenInputEvent.KeyPressed

Enclosing interface:
ClientScreenInputEvent

public static interface ClientScreenInputEvent.KeyPressed
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionResult
    keyPressed(net.minecraft.client.Minecraft client, net.minecraft.client.gui.screens.Screen screen, int keyCode, int scanCode, int modifiers)
    Invoked whenever a key press is performed inside a screen.
  • Method Details

    • keyPressed

      net.minecraft.world.InteractionResult keyPressed(net.minecraft.client.Minecraft client, net.minecraft.client.gui.screens.Screen screen, int keyCode, int scanCode, int modifiers)
      Invoked whenever a key press is performed inside a screen. Equivalent to Forge's GuiScreenEvent.KeyboardKeyPressedEvent event.

      This event is handled in two phases PRE and POST, which are invoked before and after the keys have been processed by the screen, respectively.

      Parameters:
      client - The Minecraft instance performing it.
      screen - The screen this keystroke was performed in.
      keyCode - The key code.
      scanCode - The raw keyboard scan code.
      modifiers - Additional modifiers.
      Returns:
      Any other result than InteractionResult.PASS leads to the cancellation of the key press.