Class Input

java.lang.Object
zombie.core.input.Input

public final class Input extends Object
A wrapped for all keyboard, mouse and controller input
  • Field Details

    • ANY_CONTROLLER

      public static final int ANY_CONTROLLER
      The controller index to pass to check all controllers
      See Also:
  • Constructor Details

    • Input

      public Input()
  • Method Details

    • getKeyName

      public static String getKeyName(int code)
      get the character representation of the key identified by the specified code
      Parameters:
      code - The key code of the key to retrieve the name of
      Returns:
      The name or character representation of the key requested
    • getKeyCode

      public static int getKeyCode(String keyName)
    • getControllerCount

      public int getControllerCount()
      get a count of the number of controllers available
      Returns:
      The number of controllers available
    • getAxisCount

      public int getAxisCount(int index)
      get the number of axis that are avaiable on a given controller
      Parameters:
      index - The index of the controller to check
      Returns:
      The number of axis available on the controller
    • getAxisValue

      public float getAxisValue(int index, int axis)
      get the value of the axis with the given index
      Parameters:
      index - The index of the controller to check
      axis - The index of the axis to read
      Returns:
      The axis value at time of reading
    • getAxisName

      public String getAxisName(int index, int axis)
      get the name of the axis with the given index
      Parameters:
      index - The index of the controller to check
      axis - The index of the axis to read
      Returns:
      The name of the specified axis
    • isControllerLeftD

      public boolean isControllerLeftD(int index)
      Check if the controller has the left direction pressed
      Parameters:
      index - The index of the controller to check
      Returns:
      True if the controller is pressed to the left
    • isControllerRightD

      public boolean isControllerRightD(int index)
      Check if the controller has the right direction pressed
      Parameters:
      index - The index of the controller to check
      Returns:
      True if the controller is pressed to the right
    • isControllerUpD

      public boolean isControllerUpD(int index)
      Check if the controller has the up direction pressed
      Parameters:
      index - The index of the controller to check
      Returns:
      True if the controller is pressed to the up
    • isControllerDownD

      public boolean isControllerDownD(int index)
      Check if the controller has the down direction pressed
      Parameters:
      index - The index of the controller to check
      Returns:
      True if the controller is pressed to the down
    • isButtonPressedD

      public boolean isButtonPressedD(int button, int index)
      Check if controller button is pressed
      Parameters:
      index - The index of the controller to check
      button - The index of the button to check
      Returns:
      True if the button is pressed
    • wasButtonPressed

      public boolean wasButtonPressed(int index, int button)
      Check if a controller button was pressed the previous frame.
      Parameters:
      index - The controller index.
      button - The button index.
      Returns:
      true if the controller button was in the pressed state the previous frame.
    • isButtonStartPress

      public boolean isButtonStartPress(int index, int button)
    • isButtonReleasePress

      public boolean isButtonReleasePress(int index, int button)
    • initControllers

      public void initControllers()
      Initialise the controllers system
    • poll

      public void poll()
      Poll the state of the input
    • getController

      public org.lwjglx.input.Controller getController(int index)
    • getButtonCount

      public int getButtonCount(int index)
    • getButtonName

      public String getButtonName(int index, int button)
    • updateGameThread

      public void updateGameThread()
    • quit

      public void quit()