Interface InputHandlerFragment
- All Superinterfaces:
Fragment
,RawInputListener
A fragment that intercept raw input events. It extends
RawInputListener
and is automatically
registered with the InputManager
when the component is initialized.
If higher-level input handling is needed, the
The onXXEvents are called only if the component is enabled.
receiveInputManager(InputManager)
method can be overridden to receive the
InputManager
instance and register additional input listeners.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault void
Called before a batch of input will be sent to thisRawInputListener
.default void
endInput()
Called after a batch of input was sent to thisRawInputListener
.default void
Invoked on joystick axis events.default void
Invoked on joystick button presses.default void
onKeyEvent
(KeyInputEvent evt) Invoked on keyboard key press or release events.default void
Invoked on mouse button events.default void
Invoked on mouse movement/motion events.default void
onTouchEvent
(TouchEvent evt) Invoked on touchscreen touch events.default void
receiveInputManager
(InputManager inputManager) Receives the InputManager instance when the component is initialized.
-
Method Details
-
beginInput
default void beginInput()Description copied from interface:RawInputListener
Called before a batch of input will be sent to thisRawInputListener
.- Specified by:
beginInput
in interfaceRawInputListener
-
endInput
default void endInput()Description copied from interface:RawInputListener
Called after a batch of input was sent to thisRawInputListener
. The listener should set theconsumed flag
on any events that have been consumed either at this call or previous calls.- Specified by:
endInput
in interfaceRawInputListener
-
receiveInputManager
Receives the InputManager instance when the component is initialized. This method can be overridden to register additional input listeners. The reference to the InputManager can be stored and used later in the component logic. -
onJoyAxisEvent
Description copied from interface:RawInputListener
Invoked on joystick axis events.- Specified by:
onJoyAxisEvent
in interfaceRawInputListener
- Parameters:
evt
- information about the event
-
onJoyButtonEvent
Description copied from interface:RawInputListener
Invoked on joystick button presses.- Specified by:
onJoyButtonEvent
in interfaceRawInputListener
- Parameters:
evt
- information about the event
-
onMouseMotionEvent
Description copied from interface:RawInputListener
Invoked on mouse movement/motion events.- Specified by:
onMouseMotionEvent
in interfaceRawInputListener
- Parameters:
evt
- information about the event
-
onMouseButtonEvent
Description copied from interface:RawInputListener
Invoked on mouse button events.- Specified by:
onMouseButtonEvent
in interfaceRawInputListener
- Parameters:
evt
- information about the event
-
onKeyEvent
Description copied from interface:RawInputListener
Invoked on keyboard key press or release events.- Specified by:
onKeyEvent
in interfaceRawInputListener
- Parameters:
evt
- information about the event
-
onTouchEvent
Description copied from interface:RawInputListener
Invoked on touchscreen touch events.- Specified by:
onTouchEvent
in interfaceRawInputListener
- Parameters:
evt
- information about the event
-