Class GlfwJoystickInput

All Implemented Interfaces:
Input, JoyInput

public class GlfwJoystickInput extends Object implements JoyInput
The LWJGL implementation of JoyInput.
  • Constructor Details

    • GlfwJoystickInput

      public GlfwJoystickInput()
  • Method Details

    • setJoyRumble

      public void setJoyRumble(int joyId, float amount)
      Description copied from interface: JoyInput
      Causes the joystick at joyId index to rumble with the given amount.
      Specified by:
      setJoyRumble in interface JoyInput
      joyId - The joystick index
      amount - Rumble amount. Should be between 0 and 1.
    • fireJoystickConnectedEvent

      public void fireJoystickConnectedEvent(int jid)
    • fireJoystickDisconnectedEvent

      public void fireJoystickDisconnectedEvent(int jid)
    • reloadJoysticks

      public void reloadJoysticks()
    • loadJoysticks

      public Joystick[] loadJoysticks(InputManager inputManager)
      Description copied from interface: JoyInput
      Loads a list of joysticks from the system.
      Specified by:
      loadJoysticks in interface JoyInput
      inputManager - The input manager requesting to load joysticks
      A list of joysticks that are installed.
    • initialize

      public void initialize()
      Description copied from interface: Input
      Initializes the native side to listen into events from the device.
      Specified by:
      initialize in interface Input
    • update

      public void update()
      Description copied from interface: Input
      Queries the device for input. All events should be sent to the RawInputListener set with setInputListener.
      Specified by:
      update in interface Input
      See Also:
    • destroy

      public void destroy()
      Description copied from interface: Input
      Ceases listening to events from the device.
      Specified by:
      destroy in interface Input
    • isInitialized

      public boolean isInitialized()
      Specified by:
      isInitialized in interface Input
      True if the device has been initialized and not destroyed.
      See Also:
    • setInputListener

      public void setInputListener(RawInputListener listener)
      Description copied from interface: Input
      Sets the input listener to receive events from this device. The appropriate events should be dispatched through the callbacks in RawInputListener.
      Specified by:
      setInputListener in interface Input
      listener - the desired listener
    • getInputTimeNanos

      public long getInputTimeNanos()
      Specified by:
      getInputTimeNanos in interface Input
      The current absolute time as nanoseconds. This time is expected to be relative to the time given in InputEvents time property.