Class PlayerEvent.KeyPressedEvent

java.lang.Object
net.minecraftforge.fml.common.eventhandler.Event
noppes.npcs.api.event.CustomNPCsEvent
noppes.npcs.api.event.PlayerEvent
noppes.npcs.api.event.PlayerEvent.KeyPressedEvent
Enclosing class:
PlayerEvent

public static class PlayerEvent.KeyPressedEvent
extends PlayerEvent
keyPressed
Called when a players press and releases a button, Wont be called when a gui or chat is opened or if a button is held for a longer time.
Button has to be held less then 0.5 seconds.
Currently does not support multiple button presses,
eg: pressing 'a' and then 'd' and then releasing 'a' and then 'd' will no cause the event to trigger
  • Field Details

    • key

      public final int key
      Keyboard button pressed, (key codes
    • isCtrlPressed

      public final boolean isCtrlPressed
    • isAltPressed

      public final boolean isAltPressed
    • isShiftPressed

      public final boolean isShiftPressed
    • isMetaPressed

      public final boolean isMetaPressed
      This is the windows or apple key
  • Constructor Details

    • KeyPressedEvent

      public KeyPressedEvent​(IPlayer player, int key, boolean isCtrlPressed, boolean isAltPressed, boolean isShiftPressed, boolean isMetaPressed)