Class Input

java.lang.Object
de.gurkenlabs.litiengine.input.Input

public final class Input
extends java.lang.Object
The static Input class is the LITIENGINE's access point to devices that capture physical player input. It manages input from different devices, i.e. keyboard, mouse or gamepad, and provides a unified API to access this information.
See Also:
mouse(), keyboard(), gamepads()
  • Nested Class Summary

    Nested Classes 
    Modifier and TypeClassDescription
    static class Input.InputGameAdapter 
  • Method Summary

    Modifier and TypeMethodDescription
    static GamepadManagergamepads()
    Gets the manager for all gamepad input devices.
    static IKeyboardkeyboard()
    Gets the keyboard input device.
    static IMousemouse()
    Gets the mouse input device.

    Methods inherited from class java.lang.Object

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

    • gamepads

      public static GamepadManager gamepads()
      Gets the manager for all gamepad input devices.

      The manager provides easy access to the default controller as well as access by gamepad index for mulitplayer games. Gamepads don't need to be added explicitly, the manager supports hot-plugging at runtime and will auto-detect any added/removed gamepads.

      This returns null if Game.config().input().isGamepadSupport() is set to false.

      Returns:
      The gamepad manager.
      See Also:
      GamepadManager.current(), GamepadManager.get(int)
    • keyboard

      public static IKeyboard keyboard()
      Gets the keyboard input device.
      Returns:
      The keyboard input device.
    • mouse

      public static IMouse mouse()
      Gets the mouse input device.
      Returns:
      The mouse input device.