Package com.jme3.input.android
Class AndroidTouchInput
- java.lang.Object
-
- com.jme3.input.android.AndroidTouchInput
-
- All Implemented Interfaces:
com.jme3.input.Input,com.jme3.input.TouchInput
- Direct Known Subclasses:
AndroidTouchInput14
public class AndroidTouchInput extends java.lang.Object implements com.jme3.input.TouchInputAndroidTouchInput is the base class that receives touch inputs from the Android system and creates the TouchEvents for jME. This class is designed to handle the base touch events for Android rev 9 (Android 2.3). This is extended by other classes to add features that were introduced after Android rev 9.- Author:
- iwgeric
-
-
Field Summary
Fields Modifier and Type Field Description protected AndroidInputHandlerandroidInputprotected intnumPointers
-
Constructor Summary
Constructors Constructor Description AndroidTouchInput(AndroidInputHandler androidInput)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEvent(com.jme3.input.event.InputEvent event)voiddestroy()com.jme3.input.event.InputEventgenerateMouseEvent(com.jme3.input.event.TouchEvent event)protected intgetAction(android.view.MotionEvent event)com.jme3.input.event.TouchEventgetFreeTouchEvent()android.view.GestureDetectorgetGestureDetector()longgetInputTimeNanos()floatgetJmeX(float origX)floatgetJmeY(float origY)protected intgetPointerId(android.view.MotionEvent event)protected intgetPointerIndex(android.view.MotionEvent event)android.view.ScaleGestureDetectorgetScaleDetector()voidinitialize()floatinvertX(float origX)floatinvertY(float origY)booleanisInitialized()booleanisMouseEventsInvertX()booleanisMouseEventsInvertY()booleanisSimulateKeyboard()booleanisSimulateMouse()voidloadSettings(com.jme3.system.AppSettings settings)booleanonKey(android.view.KeyEvent event)booleanonTouch(android.view.MotionEvent event)voidsetGestureDetector(android.view.GestureDetector gestureDetector)voidsetInputListener(com.jme3.input.RawInputListener listener)voidsetOmitHistoricEvents(boolean dontSendHistory)voidsetScaleDetector(android.view.ScaleGestureDetector scaleDetector)voidsetSimulateKeyboard(boolean simulate)voidsetSimulateMouse(boolean simulate)voidupdate()
-
-
-
Field Detail
-
numPointers
protected int numPointers
-
androidInput
protected AndroidInputHandler androidInput
-
-
Constructor Detail
-
AndroidTouchInput
public AndroidTouchInput(AndroidInputHandler androidInput)
-
-
Method Detail
-
getGestureDetector
public android.view.GestureDetector getGestureDetector()
-
setGestureDetector
public void setGestureDetector(android.view.GestureDetector gestureDetector)
-
getScaleDetector
public android.view.ScaleGestureDetector getScaleDetector()
-
setScaleDetector
public void setScaleDetector(android.view.ScaleGestureDetector scaleDetector)
-
invertX
public float invertX(float origX)
-
invertY
public float invertY(float origY)
-
getJmeX
public float getJmeX(float origX)
-
getJmeY
public float getJmeY(float origY)
-
loadSettings
public void loadSettings(com.jme3.system.AppSettings settings)
-
getPointerIndex
protected int getPointerIndex(android.view.MotionEvent event)
-
getPointerId
protected int getPointerId(android.view.MotionEvent event)
-
getAction
protected int getAction(android.view.MotionEvent event)
-
onTouch
public boolean onTouch(android.view.MotionEvent event)
-
generateMouseEvent
public com.jme3.input.event.InputEvent generateMouseEvent(com.jme3.input.event.TouchEvent event)
-
onKey
public boolean onKey(android.view.KeyEvent event)
-
initialize
public void initialize()
- Specified by:
initializein interfacecom.jme3.input.Input
-
destroy
public void destroy()
- Specified by:
destroyin interfacecom.jme3.input.Input
-
isInitialized
public boolean isInitialized()
- Specified by:
isInitializedin interfacecom.jme3.input.Input
-
setInputListener
public void setInputListener(com.jme3.input.RawInputListener listener)
- Specified by:
setInputListenerin interfacecom.jme3.input.Input
-
getInputTimeNanos
public long getInputTimeNanos()
- Specified by:
getInputTimeNanosin interfacecom.jme3.input.Input
-
update
public void update()
- Specified by:
updatein interfacecom.jme3.input.Input
-
getFreeTouchEvent
public com.jme3.input.event.TouchEvent getFreeTouchEvent()
-
addEvent
public void addEvent(com.jme3.input.event.InputEvent event)
-
setSimulateMouse
public void setSimulateMouse(boolean simulate)
- Specified by:
setSimulateMousein interfacecom.jme3.input.TouchInput
-
isSimulateMouse
public boolean isSimulateMouse()
- Specified by:
isSimulateMousein interfacecom.jme3.input.TouchInput
-
isMouseEventsInvertX
public boolean isMouseEventsInvertX()
-
isMouseEventsInvertY
public boolean isMouseEventsInvertY()
-
setSimulateKeyboard
public void setSimulateKeyboard(boolean simulate)
- Specified by:
setSimulateKeyboardin interfacecom.jme3.input.TouchInput
-
isSimulateKeyboard
public boolean isSimulateKeyboard()
- Specified by:
isSimulateKeyboardin interfacecom.jme3.input.TouchInput
-
setOmitHistoricEvents
public void setOmitHistoricEvents(boolean dontSendHistory)
- Specified by:
setOmitHistoricEventsin interfacecom.jme3.input.TouchInput
-
-