Class Bind

java.lang.Object
dev.boze.api.utility.input.Bind

public class Bind extends Object
Represents a keyboard or mouse button binding
A bind can be either a keyboard key or a mouse button, identified by its GLFW code
This class is used throughout Boze to handle input bindings for modules and other features
  • Constructor Summary

    Constructors
    Constructor
    Description
    Bind(boolean isButton, int bind)
    Creates a new bind
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the GLFW code for this bind
    For keyboard keys, this returns a GLFW_KEY_* constant
    For mouse buttons, this returns a GLFW_MOUSE_BUTTON_* constant
    boolean
    Checks if this bind is a mouse button

    Methods inherited from class Object

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

    • Bind

      public Bind(boolean isButton, int bind)
      Creates a new bind
      Parameters:
      isButton - Whether this bind is a mouse button (true) or keyboard key (false)
      bind - The GLFW code for the key or button
  • Method Details

    • getBind

      public int getBind()
      Gets the GLFW code for this bind
      For keyboard keys, this returns a GLFW_KEY_* constant
      For mouse buttons, this returns a GLFW_MOUSE_BUTTON_* constant
      Returns:
      The GLFW code for this bind
    • isButton

      public boolean isButton()
      Checks if this bind is a mouse button
      Returns:
      true if this bind is a mouse button, false if it's a keyboard key