Package com.jme3.niftygui
Class InputSystemJme
java.lang.Object
com.jme3.niftygui.InputSystemJme
- All Implemented Interfaces:
RawInputListener
,de.lessvoid.nifty.spi.input.InputSystem
public class InputSystemJme
extends Object
implements de.lessvoid.nifty.spi.input.InputSystem, RawInputListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called before a batch of input will be sent to thisRawInputListener
.void
endInput()
Called after a batch of input was sent to thisRawInputListener
.void
forwardEvents
(de.lessvoid.nifty.NiftyInputConsumer nic) void
Invoked on joystick axis events.void
Invoked on joystick button presses.void
onKeyEvent
(KeyInputEvent evt) Invoked on keyboard key press or release events.void
Invoked on mouse button events.void
Invoked on mouse movement/motion events.void
onTouchEvent
(TouchEvent evt) Invoked on touchscreen touch events.void
reset()
Reset internal state of the input system.void
setHeight
(int height) void
setMousePosition
(int x, int y) void
setNifty
(de.lessvoid.nifty.Nifty nifty) Must be set in order for nifty events to be forwarded correctly.void
setResourceLoader
(de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader niftyResourceLoader)
-
Constructor Details
-
InputSystemJme
-
-
Method Details
-
setResourceLoader
public void setResourceLoader(de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader niftyResourceLoader) - Specified by:
setResourceLoader
in interfacede.lessvoid.nifty.spi.input.InputSystem
-
setNifty
public void setNifty(de.lessvoid.nifty.Nifty nifty) Must be set in order for nifty events to be forwarded correctly.- Parameters:
nifty
- the Nifty instance to use
-
reset
public void reset()Reset internal state of the input system. Must be called when the display is reinitialized or when the internal state becomes invalid. -
setHeight
public void setHeight(int height) - Parameters:
height
- The height of the viewport. Used to convert bottom-left origin to upper-left origin.
-
setMousePosition
public void setMousePosition(int x, int y) - Specified by:
setMousePosition
in interfacede.lessvoid.nifty.spi.input.InputSystem
-
beginInput
public void beginInput()Description copied from interface:RawInputListener
Called before a batch of input will be sent to thisRawInputListener
.- Specified by:
beginInput
in interfaceRawInputListener
-
endInput
public 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
-
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
-
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
-
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
-
forwardEvents
public void forwardEvents(de.lessvoid.nifty.NiftyInputConsumer nic) - Specified by:
forwardEvents
in interfacede.lessvoid.nifty.spi.input.InputSystem
-