Class EventBind


public class EventBind extends CancellableEvent
EventBind

Event fired when a key or mouse button is pressed, repeated, or released

This event allows addons to intercept and modify input binding behavior
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The action that occurred
    int
    The key code or mouse button that was pressed/released
    boolean
    Whether this bind represents a mouse button (true) or keyboard key (false)
    int
    Modifier keys that were held during the action (only applicable for keyboard keys)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static EventBind
    get(int bind, int action, boolean isButton, int modifiers)
    Creates a new EventBind instance

    Methods inherited from class dev.boze.api.event.CancellableEvent

    cancel, isCancelled, setCancelled

    Methods inherited from class java.lang.Object

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

    • bind

      public int bind
      The key code or mouse button that was pressed/released
    • action

      public int action
      The action that occurred

      GLFW_RELEASE = 0 (The key or button was released)
      GLFW_PRESS = 1 (The key or button was pressed)
      GLFW_REPEAT = 2 (The key was held down until it repeated)
    • isButton

      public boolean isButton
      Whether this bind represents a mouse button (true) or keyboard key (false)
    • modifiers

      public int modifiers
      Modifier keys that were held during the action (only applicable for keyboard keys)
  • Constructor Details

    • EventBind

      public EventBind()
  • Method Details

    • get

      public static EventBind get(int bind, int action, boolean isButton, int modifiers)
      Creates a new EventBind instance
      Parameters:
      bind - The key code or mouse button
      action - The action that occurred (GLFW_PRESS, GLFW_RELEASE, GLFW_REPEAT)
      isButton - Whether this is a mouse button binding
      modifiers - Modifier keys held (0 for mouse buttons)
      Returns:
      The EventBind instance