The rapper class to move it like MotionEvent in Android.

Embed: (wiki syntax)

« Back to documentation index

MotionEventCtl Class Reference

MotionEventCtl Class Reference

The class to set the price as MotionEvent. More...

#include <MotionEvent.h>

Inherits MotionEvent.

Public Member Functions

void clearPointerCount ()
 Initialize of touch information.
void setPosData (int id, uint32_t x, uint32_t y)
 Set the coordinate.
void setActionInfo (int action, long time)
 Set the action.
float getX ()
 getX(int) for the first pointer index (may be an arbitrary pointer identifier).
float getX (int pointerIndex)
 Returns the X coordinate of this event for the given pointer index (use getPointerId(int) to find the pointer identifier for this index).
float getY ()
 getY(int) for the first pointer index (may be an arbitrary pointer identifier).
float getY (int pointerIndex)
 Returns the Y coordinate of this event for the given pointer index (use getPointerId(int) to find the pointer identifier for this index).
int getPointerCount ()
 The number of pointers of data contained in this event.
int getPointerId (int pointerIndex)
 Return the pointer identifier associated with a particular pointer data index in this event.
int getAction ()
 Return the kind of action being performed.
int getActionMasked ()
 Return the masked action being performed, without pointer index information.
long getDownTime ()
 Returns the time (in ms) when the user originally pressed down to start a stream of position events.
long getEventTime ()
 Retrieve the time this event occurred, in the uptimeMillis() time base.
int findPointerIndex (int pointerId)
 Given a pointer identifier, find the index of its data in the event.
void debug_print ()
 printf output function for debugging

Static Public Attributes

static const int ACTION_POINTER_INDEX_MASK = 0x0000ff00
 Bits in the action code that represent a pointer index, used with ACTION_POINTER_DOWN and ACTION_POINTER_UP.
static const int ACTION_POINTER_INDEX_SHIFT = 0x00000008
 Bit shift for the action bits holding the pointer index as defined by ACTION_POINTER_INDEX_MASK.
static const int ACTION_MASK = 0x000000ff
 Bit mask of the parts of the action code that are the action itself.
static const int TOUCH_NUM_MAX = 2
 The maximum number of touch.

Detailed Description

The class to set the price as MotionEvent.

Definition at line 166 of file MotionEvent.h.


Member Function Documentation

void clearPointerCount (  )

Initialize of touch information.

Definition at line 99 of file MotionEvent.cpp.

void debug_print (  ) [inherited]

printf output function for debugging

Definition at line 70 of file MotionEvent.cpp.

int findPointerIndex ( int  pointerId ) [inherited]

Given a pointer identifier, find the index of its data in the event.

Parameters:
pointerIdThe identifier of the pointer to be found.
Returns:
Returns either the index of the pointer (for use with getX(int) et al.), or -1 if there is no data available for that pointer identifier.

Definition at line 59 of file MotionEvent.cpp.

int getAction (  ) [inherited]

Return the kind of action being performed.

Consider using getActionMasked() and getActionIndex() to retrieve the separate masked action and pointer index.

Returns:
The action, such as ACTION_DOWN or the combination of ACTION_POINTER_DOWN with a shifted pointer index.

Definition at line 43 of file MotionEvent.cpp.

int getActionMasked (  ) [inherited]

Return the masked action being performed, without pointer index information.

Use getActionIndex() to return the index associated with pointer actions.

Returns:
The action, such as ACTION_DOWN or ACTION_POINTER_DOWN.

Definition at line 47 of file MotionEvent.cpp.

long getDownTime (  ) [inherited]

Returns the time (in ms) when the user originally pressed down to start a stream of position events.

Returns:
long

Definition at line 51 of file MotionEvent.cpp.

long getEventTime (  ) [inherited]

Retrieve the time this event occurred, in the uptimeMillis() time base.

Returns:
Returns the time this event occurred, in the uptimeMillis() time base.

Definition at line 55 of file MotionEvent.cpp.

int getPointerCount (  ) [inherited]

The number of pointers of data contained in this event.

Always >= 1.

Returns:
int

Definition at line 35 of file MotionEvent.cpp.

int getPointerId ( int  pointerIndex ) [inherited]

Return the pointer identifier associated with a particular pointer data index in this event.

The identifier tells you the actual pointer number associated with the data, accounting for individual pointers going up and down since the start of the current gesture.

Returns:
int

Definition at line 39 of file MotionEvent.cpp.

float getX (  ) [inherited]

getX(int) for the first pointer index (may be an arbitrary pointer identifier).

Returns:
float

Definition at line 19 of file MotionEvent.cpp.

float getX ( int  pointerIndex ) [inherited]

Returns the X coordinate of this event for the given pointer index (use getPointerId(int) to find the pointer identifier for this index).

Whole numbers are pixels; the value may have a fraction for input devices that are sub-pixel precise.

Parameters:
pointerIndexRaw index of pointer to retrieve. Value may be from 0 (the first pointer that is down) to getPointerCount()-1.
Returns:
float

Definition at line 23 of file MotionEvent.cpp.

float getY ( int  pointerIndex ) [inherited]

Returns the Y coordinate of this event for the given pointer index (use getPointerId(int) to find the pointer identifier for this index).

Whole numbers are pixels; the value may have a fraction for input devices that are sub-pixel precise.

Parameters:
pointerIndexRaw index of pointer to retrieve. Value may be from 0 (the first pointer that is down) to getPointerCount()-1.
Returns:
float

Definition at line 31 of file MotionEvent.cpp.

float getY (  ) [inherited]

getY(int) for the first pointer index (may be an arbitrary pointer identifier).

Returns:
float

Definition at line 27 of file MotionEvent.cpp.

void setActionInfo ( int  action,
long  time 
)

Set the action.

Parameters:
actionThe action, such as ACTION_DOWN or the combination of ACTION_POINTER_DOWN with a shifted pointer index.
timeThe time this event occurred, in the uptimeMillis() time base.

Definition at line 112 of file MotionEvent.cpp.

void setPosData ( int  id,
uint32_t  x,
uint32_t  y 
)

Set the coordinate.

Parameters:
idPointerId.
xX coordinate.
yY coordinate.

Definition at line 103 of file MotionEvent.cpp.


Field Documentation

const int ACTION_MASK = 0x000000ff [static, inherited]

Bit mask of the parts of the action code that are the action itself.

Definition at line 135 of file MotionEvent.h.

const int ACTION_POINTER_INDEX_MASK = 0x0000ff00 [static, inherited]

Bits in the action code that represent a pointer index, used with ACTION_POINTER_DOWN and ACTION_POINTER_UP.

Shifting down by ACTION_POINTER_INDEX_SHIFT provides the actual pointer index where the data for the pointer going up or down can be found; you can get its identifier with getPointerId(int) and the actual data with getX(int) etc.

Definition at line 125 of file MotionEvent.h.

const int ACTION_POINTER_INDEX_SHIFT = 0x00000008 [static, inherited]

Bit shift for the action bits holding the pointer index as defined by ACTION_POINTER_INDEX_MASK.

Definition at line 130 of file MotionEvent.h.

const int TOUCH_NUM_MAX = 2 [static, inherited]

The maximum number of touch.

Definition at line 146 of file MotionEvent.h.