类 InputEvent.Key

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.InputEvent
net.minecraftforge.client.event.InputEvent.Key
封闭类:
InputEvent

public static class InputEvent.Key extends InputEvent
Fired when a keyboard key input occurs, such as pressing, releasing, or repeating a key.

This event is not cancellable, and does not have a result.

This event is fired on the main Forge event bus, only on the logical client.

  • 字段详细资料

    • key

      private final int key
    • scanCode

      private final int scanCode
    • action

      private final int action
    • modifiers

      private final int modifiers
  • 构造器详细资料

    • Key

      @Internal public Key(int key, int scanCode, int action, int modifiers)
  • 方法详细资料

    • getKey

      public int getKey()
      返回 the GLFW (platform-agnostic) key code。
      返回:
      the GLFW (platform-agnostic) key code
      另请参阅:
    • getScanCode

      public int getScanCode()
      返回 the platform-specific scan code。

      The scan code is unique for every key, regardless of whether it has a key code. Scan codes are platform-specific but consistent over time, so keys will have different scan codes depending on the platform but they are safe to save to disk as custom key bindings.

      返回:
      the platform-specific scan code
      另请参阅:
    • getAction

      public int getAction()
      返回 the mouse button's action。
      返回:
      the mouse button's action
      另请参阅:
    • getModifiers

      public int getModifiers()
      返回 a bit field representing the active modifier keys。
      返回:
      a bit field representing the active modifier keys
      另请参阅: