-
public final class MotionEventCompat
Helper for accessing features in MotionEvent.
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
ACTION_MASK
public final static int
ACTION_POINTER_DOWN
public final static int
ACTION_POINTER_UP
public final static int
ACTION_HOVER_MOVE
public final static int
ACTION_SCROLL
public final static int
ACTION_POINTER_INDEX_MASK
public final static int
ACTION_POINTER_INDEX_SHIFT
public final static int
ACTION_HOVER_ENTER
public final static int
ACTION_HOVER_EXIT
public final static int
AXIS_X
public final static int
AXIS_Y
public final static int
AXIS_PRESSURE
public final static int
AXIS_SIZE
public final static int
AXIS_TOUCH_MAJOR
public final static int
AXIS_TOUCH_MINOR
public final static int
AXIS_TOOL_MAJOR
public final static int
AXIS_TOOL_MINOR
public final static int
AXIS_ORIENTATION
public final static int
AXIS_VSCROLL
public final static int
AXIS_HSCROLL
public final static int
AXIS_Z
public final static int
AXIS_RX
public final static int
AXIS_RY
public final static int
AXIS_RZ
public final static int
AXIS_HAT_X
public final static int
AXIS_HAT_Y
public final static int
AXIS_LTRIGGER
public final static int
AXIS_RTRIGGER
public final static int
AXIS_THROTTLE
public final static int
AXIS_RUDDER
public final static int
AXIS_WHEEL
public final static int
AXIS_GAS
public final static int
AXIS_BRAKE
public final static int
AXIS_DISTANCE
public final static int
AXIS_TILT
public final static int
AXIS_SCROLL
public final static int
AXIS_RELATIVE_X
public final static int
AXIS_RELATIVE_Y
public final static int
AXIS_GENERIC_1
public final static int
AXIS_GENERIC_2
public final static int
AXIS_GENERIC_3
public final static int
AXIS_GENERIC_4
public final static int
AXIS_GENERIC_5
public final static int
AXIS_GENERIC_6
public final static int
AXIS_GENERIC_7
public final static int
AXIS_GENERIC_8
public final static int
AXIS_GENERIC_9
public final static int
AXIS_GENERIC_10
public final static int
AXIS_GENERIC_11
public final static int
AXIS_GENERIC_12
public final static int
AXIS_GENERIC_13
public final static int
AXIS_GENERIC_14
public final static int
AXIS_GENERIC_15
public final static int
AXIS_GENERIC_16
public final static int
BUTTON_PRIMARY
-
Method Summary
Modifier and Type Method Description static int
getActionMasked(MotionEvent event)
Call getAction, returning only the ACTION_MASK portion. static int
getActionIndex(MotionEvent event)
Call getAction, returning only the pointer indexportion. static int
findPointerIndex(MotionEvent event, int pointerId)
Call findPointerIndex. static int
getPointerId(MotionEvent event, int pointerIndex)
Call getPointerId. static float
getX(MotionEvent event, int pointerIndex)
Call getX. static float
getY(MotionEvent event, int pointerIndex)
Call getY. static int
getPointerCount(MotionEvent event)
The number of pointers of data contained in this event. static int
getSource(MotionEvent event)
Gets the source of the event. static boolean
isFromSource(MotionEvent event, int source)
Determines whether the event is from the given source. static float
getAxisValue(MotionEvent event, int axis)
Get axis value for the first pointer index (may be anarbitrary pointer identifier). static float
getAxisValue(MotionEvent event, int axis, int pointerIndex)
Returns the value of the requested axis for the given pointer index(use getPointerId to find the pointer identifier for this index). static int
getButtonState(MotionEvent event)
-
-
Method Detail
-
getActionMasked
@Deprecated() static int getActionMasked(MotionEvent event)
Call getAction, returning only the ACTION_MASK portion.
-
getActionIndex
@Deprecated() static int getActionIndex(MotionEvent event)
Call getAction, returning only the pointer indexportion.
-
findPointerIndex
@Deprecated() static int findPointerIndex(MotionEvent event, int pointerId)
Call findPointerIndex.
-
getPointerId
@Deprecated() static int getPointerId(MotionEvent event, int pointerIndex)
Call getPointerId.
-
getX
@Deprecated() static float getX(MotionEvent event, int pointerIndex)
Call getX.
-
getY
@Deprecated() static float getY(MotionEvent event, int pointerIndex)
Call getY.
-
getPointerCount
@Deprecated() static int getPointerCount(MotionEvent event)
The number of pointers of data contained in this event. Always
-
getSource
@Deprecated() static int getSource(MotionEvent event)
Gets the source of the event.
-
isFromSource
static boolean isFromSource(MotionEvent event, int source)
Determines whether the event is from the given source.
- Parameters:
source
- The input source to check against.
-
getAxisValue
@Deprecated() static float getAxisValue(MotionEvent event, int axis)
Get axis value for the first pointer index (may be anarbitrary pointer identifier).
- Parameters:
axis
- The axis identifier for the axis value to retrieve.
-
getAxisValue
@Deprecated() static float getAxisValue(MotionEvent event, int axis, int pointerIndex)
Returns the value of the requested axis for the given pointer index(use getPointerId to find the pointer identifier for this index).
- Parameters:
axis
- The axis identifier for the axis value to retrieve.pointerIndex
- Raw index of pointer to retrieve.
-
getButtonState
@Deprecated() static int getButtonState(MotionEvent event)
-
-
-
-