public class InputSystemJme extends java.lang.Object implements de.lessvoid.nifty.spi.input.InputSystem, RawInputListener
Constructor and Description |
---|
InputSystemJme(InputManager inputManager) |
Modifier and Type | Method and Description |
---|---|
void |
beginInput()
Called before a batch of input will be sent to this
RawInputListener . |
void |
endInput()
Called after a batch of input was sent to this
RawInputListener . |
void |
forwardEvents(de.lessvoid.nifty.NiftyInputConsumer nic) |
void |
onJoyAxisEvent(JoyAxisEvent evt)
Invoked on joystick axis events.
|
void |
onJoyButtonEvent(JoyButtonEvent evt)
Invoked on joystick button presses.
|
void |
onKeyEvent(KeyInputEvent evt)
Invoked on keyboard key press or release events.
|
void |
onMouseButtonEvent(MouseButtonEvent evt)
Invoked on mouse button events.
|
void |
onMouseMotionEvent(MouseMotionEvent evt)
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) |
public InputSystemJme(InputManager inputManager)
public void setResourceLoader(de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader niftyResourceLoader)
setResourceLoader
in interface de.lessvoid.nifty.spi.input.InputSystem
public void setNifty(de.lessvoid.nifty.Nifty nifty)
nifty
- the Nifty instance to usepublic void reset()
public void setHeight(int height)
height
- The height of the viewport. Used to convert
bottom-left origin to upper-left origin.public void setMousePosition(int x, int y)
setMousePosition
in interface de.lessvoid.nifty.spi.input.InputSystem
public void beginInput()
RawInputListener
RawInputListener
.beginInput
in interface RawInputListener
public void endInput()
RawInputListener
RawInputListener
.
The listener should set the consumed flag
on any events that have been consumed either at this call or previous calls.endInput
in interface RawInputListener
public void onMouseMotionEvent(MouseMotionEvent evt)
RawInputListener
onMouseMotionEvent
in interface RawInputListener
evt
- information about the eventpublic void onMouseButtonEvent(MouseButtonEvent evt)
RawInputListener
onMouseButtonEvent
in interface RawInputListener
evt
- information about the eventpublic void onJoyAxisEvent(JoyAxisEvent evt)
RawInputListener
onJoyAxisEvent
in interface RawInputListener
evt
- information about the eventpublic void onJoyButtonEvent(JoyButtonEvent evt)
RawInputListener
onJoyButtonEvent
in interface RawInputListener
evt
- information about the eventpublic void onKeyEvent(KeyInputEvent evt)
RawInputListener
onKeyEvent
in interface RawInputListener
evt
- information about the eventpublic void onTouchEvent(TouchEvent evt)
RawInputListener
onTouchEvent
in interface RawInputListener
evt
- information about the eventpublic void forwardEvents(de.lessvoid.nifty.NiftyInputConsumer nic)
forwardEvents
in interface de.lessvoid.nifty.spi.input.InputSystem