Package com.jme3.input.android
Class AndroidMouseInput14
java.lang.Object
com.jme3.input.android.AndroidMouseInput14
- All Implemented Interfaces:
Input,MouseInput
- Direct Known Subclasses:
AndroidMouseInput24
AndroidMouseInput14 implements MouseInput to add mouse support for jME3
uses the onGenericMotion events that where added in Android rev 12 and MotionEvent.getButtonState
from Android rev 14 so added "14" suffix to the class to specify the Android required rev and
match other classes naming-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface com.jme3.input.MouseInput
AXIS_WHEEL, AXIS_X, AXIS_Y, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddMouseButtonEvent(boolean left, boolean right, boolean center, int x, int y) protected voidaddMouseMotionEventFixedPositions(int x, int y, int deltaWheel) protected voidaddMouseMotionEventRelativePositions(int deltaX, int deltaY, int deltaWheel) voiddestroy()Ceases listening to events from the device.intReturns the number of buttons the mouse has.longprotected intgetJmeX(float origX) protected intgetJmeY(float origY) voidInitializes the native side to listen into events from the device.booleanvoidloadSettings(AppSettings settings) booleanonGenericMotion(android.view.MotionEvent event) booleanonHover(android.view.MotionEvent event) voidsetCursorVisible(boolean visible) Set whether the mouse cursor should be visible or not.voidsetInputListener(RawInputListener listener) Sets the input listener to receive events from this device.voidsetNativeCursor(JmeCursor cursor) Sets the cursor to use.voidupdate()Queries the device for input.
-
Field Details
-
inputHandler
-
-
Constructor Details
-
AndroidMouseInput14
-
-
Method Details
-
getJmeX
protected int getJmeX(float origX) -
getJmeY
protected int getJmeY(float origY) -
loadSettings
-
addMouseMotionEventFixedPositions
protected void addMouseMotionEventFixedPositions(int x, int y, int deltaWheel) -
addMouseMotionEventRelativePositions
protected void addMouseMotionEventRelativePositions(int deltaX, int deltaY, int deltaWheel) -
addMouseButtonEvent
protected boolean addMouseButtonEvent(boolean left, boolean right, boolean center, int x, int y) -
onHover
public boolean onHover(android.view.MotionEvent event) -
onGenericMotion
public boolean onGenericMotion(android.view.MotionEvent event) -
setCursorVisible
public void setCursorVisible(boolean visible) Description copied from interface:MouseInputSet whether the mouse cursor should be visible or not.- Specified by:
setCursorVisiblein interfaceMouseInput- Parameters:
visible- Whether the mouse cursor should be visible or not.
-
getButtonCount
public int getButtonCount()Description copied from interface:MouseInputReturns the number of buttons the mouse has. Typically 3 for most mice.- Specified by:
getButtonCountin interfaceMouseInput- Returns:
- the number of buttons the mouse has.
-
setNativeCursor
Description copied from interface:MouseInputSets the cursor to use.- Specified by:
setNativeCursorin interfaceMouseInput- Parameters:
cursor- The cursor to use.
-
initialize
public void initialize()Description copied from interface:InputInitializes the native side to listen into events from the device.- Specified by:
initializein interfaceInput
-
update
public void update()Description copied from interface:InputQueries the device for input. All events should be sent to the RawInputListener set with setInputListener. -
destroy
public void destroy()Description copied from interface:InputCeases listening to events from the device. -
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceInput- Returns:
- True if the device has been initialized and not destroyed.
- See Also:
-
setInputListener
Description copied from interface:InputSets the input listener to receive events from this device. The appropriate events should be dispatched through the callbacks in RawInputListener.- Specified by:
setInputListenerin interfaceInput- Parameters:
listener- the desired listener
-
getInputTimeNanos
public long getInputTimeNanos()- Specified by:
getInputTimeNanosin interfaceInput- Returns:
- The current absolute time as nanoseconds. This time is expected to be relative to the time given in InputEvents time property.
-