Class GLFWWindow.InputAdapter

java.lang.Object
com.blackrook.gloop.glfw.GLFWWindow.InputAdapter
All Implemented Interfaces:
GLFWWindow.InputListener
Enclosing class:
GLFWWindow

public static class GLFWWindow.InputAdapter extends Object implements GLFWWindow.InputListener
An implementation of GLFWWindow.InputListener that provides a blank, no-op implementation so that only the desired functions need overriding.
Author:
Matthew Tropiano
  • Constructor Details

    • InputAdapter

      public InputAdapter()
  • Method Details

    • onKeyPress

      public void onKeyPress(GLFWWindow window, int glfwKey, int scanCode, int modFlags)
      Description copied from interface: GLFWWindow.InputListener
      Called when a key is pressed.
      Specified by:
      onKeyPress in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      glfwKey - the key code as a GLFW id.
      scanCode - the system-specific scancode.
      modFlags - the key modifier flags active.
    • onKeyRepeated

      public void onKeyRepeated(GLFWWindow window, int glfwKey, int scanCode, int modFlags)
      Description copied from interface: GLFWWindow.InputListener
      Called when a key is repeat-fired via being held during a press.
      Specified by:
      onKeyRepeated in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      glfwKey - the key code as a GLFW id.
      scanCode - the system-specific scancode.
      modFlags - the key modifier flags active.
    • onKeyRelease

      public void onKeyRelease(GLFWWindow window, int glfwKey, int scanCode, int modFlags)
      Description copied from interface: GLFWWindow.InputListener
      Called when a key is released.
      Specified by:
      onKeyRelease in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      glfwKey - the key code as a GLFW id.
      scanCode - the system-specific scancode.
      modFlags - the key modifier flags active.
    • onKeyTyped

      public void onKeyTyped(GLFWWindow window, char c)
      Description copied from interface: GLFWWindow.InputListener
      Called when a key character is typed (character).
      Specified by:
      onKeyTyped in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      c - the key character typed.
    • onMousePosition

      public void onMousePosition(GLFWWindow window, double x, double y)
      Description copied from interface: GLFWWindow.InputListener
      Called when the mouse cursor is moved in the window.
      Specified by:
      onMousePosition in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      x - the mouse cursor position in the window, x-axis.
      y - the mouse cursor position in the window, y-axis.
    • onMouseButtonPress

      public void onMouseButtonPress(GLFWWindow window, int glfwButton, int modFlags)
      Description copied from interface: GLFWWindow.InputListener
      Called when a mouse button is pressed.
      Specified by:
      onMouseButtonPress in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      glfwButton - the mouse button code as a GLFW id.
      modFlags - the key modifier flags active.
    • onMouseButtonRelease

      public void onMouseButtonRelease(GLFWWindow window, int glfwButton, int modFlags)
      Description copied from interface: GLFWWindow.InputListener
      Called when a mouse button is released.
      Specified by:
      onMouseButtonRelease in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      glfwButton - the mouse button code as a GLFW id.
      modFlags - the key modifier flags active.
    • onScroll

      public void onScroll(GLFWWindow window, double x, double y)
      Description copied from interface: GLFWWindow.InputListener
      Called when a scrolling action occurs.
      Specified by:
      onScroll in interface GLFWWindow.InputListener
      Parameters:
      window - the source window.
      x - the scroll amount, x-axis.
      y - the scroll amount, y-axis.