blip
0.1
|
A motion input event. More...
#include <MotionEvent.hpp>
Public Member Functions | |
virtual | ~MotionEvent () |
Destructor. More... | |
Action | getAction () const |
Get the motion action for this event. More... | |
int | getActionPointerIndex () const |
If the motion action was Action_Up or Action_Down, returns the pointer index for that action, otherwise returns -1. More... | |
const ccxx::Flags< uint32_t > | getFlags () const |
Get the flags associated with this event. More... | |
uint32_t | getMetaState () const |
Get the state of any modifier keys at the time of this event. More... | |
const ccxx::Flags< uint32_t > | getButtonState () const |
TODO. More... | |
const ccxx::Flags< uint32_t > | getEdgeFlags () const |
Get a bitmask indicating which edges, if any, were touched during this event. More... | |
time_ms_t | getDownTime () const |
Get the time at which the user first pressed down to begin a stream of position events. More... | |
virtual time_ms_t | getEventTime () const |
Get the time at which this event occurred. More... | |
float | getXOffset () const |
Get the X-coordinate offset. More... | |
float | getYOffset () const |
Get the Y-coordinate offset. More... | |
float | getXPrecision () const |
Get the precision of the X-coordinates being reported. More... | |
float | getYPrecision () const |
Get the precision of the Y-coordinates being reported. More... | |
int | getPointerCount () const |
Get the number of distinct pointers being reported in this event. More... | |
int32_t | getPointerID (int pointerIndex) const |
Get the pointer identifier associated with a particular pointer data index is this event. More... | |
ToolType | getToolType (int pointerIndex) const |
Get the tool type of a pointer. More... | |
float | getRawX (int pointerIndex) const |
Get the raw X-coordinate of this event for the given pointer index. More... | |
float | getRawY (int pointerIndex) const |
Get the raw Y-coordinate of this event for the given pointer index. More... | |
float | getX (int pointerIndex) const |
Get the current X-coordinate of this event for the given pointer index. More... | |
float | getY (int pointerIndex) const |
Get the current Y-coordinate of this event for the given pointer index. More... | |
float | getPressure (int pointerIndex) const |
Get the current pressure of this event for the given pointer index. More... | |
float | getSize (int pointerIndex) const |
Get the current scaled value of the approximate size for the given pointer index. More... | |
float | getOrientation (int pointerIndex) const |
Get the current orientation of the touch area and tool area in radians clockwise from vertical for the given pointer index. More... | |
float | getTouchMinor (int pointerIndex) const |
Get the current length of the minor axis of an ellipse that describes the touch area at the point of contact for the given pointer index. More... | |
float | getTouchMajor (int pointerIndex) const |
Get the current length of the major axis of an ellipse that describes the touch area at the point of contact for the given pointer index. More... | |
float | getToolMinor (int pointerIndex) const |
Get the current length of the minor axis of an ellipse that describes the size of the approaching tool for the given pointer index. More... | |
float | getToolMajor (int pointerIndex) const |
Get the current length of the major axis of an ellipse that describes the size of the approaching tool for the given pointer index. More... | |
float | getAxisValue (Axis axis, int pointerIndex) const |
Get the value of the requested axis. More... | |
uint_t | getHistorySize () const |
Get the number of historical points in this event. More... | |
time_ms_t | getHistoricalEventTime (int historyIndex) const |
Get the amount of time that elapsed between this event and the previous event, in nanoseconds. More... | |
float | getHistoricalRawX (int historyIndex, int pointerIndex) const |
Get the historical raw X-coordinate of this event for the given pointer index. More... | |
float | getHistoricalRawY (int historyIndex, int pointerIndex) const |
Get the historical raw Y-coordinate of this event for the given pointer index. More... | |
float | getHistoricalX (int historyIndex, int pointerIndex) const |
Get the historical X-coordinate of this event for the given pointer index. More... | |
float | getHistoricalY (int historyIndex, int pointerIndex) const |
Get the historical Y-coordinate of this event for the given pointer index. More... | |
float | getHistoricalPressure (int historyIndex, int pointerIndex) const |
Get the current pressure of this event for the given pointer index. More... | |
float | getHistoricalSize (int historyIndex, int pointerIndex) const |
Get the historical scaled value of the approximate size for the given pointer index. More... | |
float | getHistoricalOrientation (int historyIndex, int pointerIndex) const |
Get the historical orientation of the touch area and tool area in radians clockwise from vertical for the given pointer index. More... | |
float | getHistoricalTouchMinor (int historyIndex, int pointerIndex) const |
Get the historical length of the minor axis of an ellipse that describes the touch area for the given pointer index. More... | |
float | getHistoricalTouchMajor (int historyIndex, int pointerIndex) const |
Get the historical length of the major axis of an ellipse that describes the touch area for the given pointer index. More... | |
float | getHistoricalToolMinor (int historyIndex, int pointerIndex) const |
Get the historical length of the minor axis of an ellipse that describes the size of the approaching tool for the given pointer index. More... | |
float | getHistoricalToolMajor (int historyIndex, int pointerIndex) const |
Get the historical length of the major axis of an ellipse that describes the size of the approaching tool for the given pointer index. More... | |
float | getHistoricalAxisValue (int historyIndex, Axis axis, int pointerIndex) const |
Get the historical value of the requested axis. More... | |
int32_t | getDeviceID () const |
Get the ID of the input device which is the source of this event. More... | |
virtual Source | getSource () const |
Get the source of this event. More... | |
Class | getClass () const |
Get the class of this event. More... | |
Type | getType () const |
Get the event type. More... | |
Static Public Attributes | |
static const uint32_t | FLAG_WINDOW_IS_OBSCURED = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED |
A flag indicating that the window that received the event is partially or completely obscured. More... | |
static const uint32_t | EDGE_TOP_MASK = AMOTION_EVENT_EDGE_FLAG_TOP |
A bitmask for testing if the motion event intersected the top edge of the screen. More... | |
static const uint32_t | EDGE_BOTTOM_MASK = AMOTION_EVENT_EDGE_FLAG_BOTTOM |
A bitmask for testing if the motion event intersected the bottom edge of the screen. More... | |
static const uint32_t | EDGE_LEFT_MASK = AMOTION_EVENT_EDGE_FLAG_LEFT |
A bitmask for testing if the motion event intersected the left edge of the screen. More... | |
static const uint32_t | EDGE_RIGHT_MASK = AMOTION_EVENT_EDGE_FLAG_RIGHT |
A bitmask for testing if the motion event intersected the right edge of the screen. More... | |
A motion input event.
Motion events include multi-touch events and mouse or trackball events.
enum Action |
Motion actions.
enum Axis |
Axis types.
enum Button |
|
inherited |
|
inherited |
enum ToolType |
|
inherited |
|
virtual |
Destructor.
MotionEvent::Action getAction | ( | ) | const |
Get the motion action for this event.
int getActionPointerIndex | ( | ) | const |
If the motion action was Action_Up or Action_Down, returns the pointer index for that action, otherwise returns -1.
float getAxisValue | ( | Axis | axis, |
int | pointerIndex | ||
) | const |
Get the value of the requested axis.
axis | The axis. |
pointerIndex | The pointer index. |
const Flags< uint32_t > getButtonState | ( | ) | const |
TODO.
|
inherited |
Get the class of this event.
|
inherited |
Get the ID of the input device which is the source of this event.
time_ms_t getDownTime | ( | ) | const |
Get the time at which the user first pressed down to begin a stream of position events.
const Flags< uint32_t > getEdgeFlags | ( | ) | const |
Get a bitmask indicating which edges, if any, were touched during this event.
This is only meaningful for ACTION_DOWN events.
|
virtual |
Get the time at which this event occurred.
Implements InputEvent.
const Flags< uint32_t > getFlags | ( | ) | const |
Get the flags associated with this event.
float getHistoricalAxisValue | ( | int | historyIndex, |
Axis | axis, | ||
int | pointerIndex | ||
) | const |
Get the historical value of the requested axis.
See getAxisValue() for details.
historyIndex | The index into the event history. |
axis | The axis. |
pointerIndex | The pointer index. |
time_ms_t getHistoricalEventTime | ( | int | historyIndex | ) | const |
Get the amount of time that elapsed between this event and the previous event, in nanoseconds.
Only applies to MotionEvent::Action_Move events.
float getHistoricalOrientation | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical orientation of the touch area and tool area in radians clockwise from vertical for the given pointer index.
See getOrientation() for more details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalPressure | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the current pressure of this event for the given pointer index.
The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), however values higher than 1 may be generated depending on the calibration of the input device. See getPressure() for more details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalRawX | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical raw X-coordinate of this event for the given pointer index.
See getRawX() for more details.
historyIndex | The index into the event history. |
pointerIndex | The pinter index. |
float getHistoricalRawY | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical raw Y-coordinate of this event for the given pointer index.
See getRawY() for more details.
historyIndex | The index into the event history. |
pointerIndex | The pinter index. |
float getHistoricalSize | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical scaled value of the approximate size for the given pointer index.
see getSize() for more details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalToolMajor | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical length of the major axis of an ellipse that describes the size of the approaching tool for the given pointer index.
See getToolMajor() for details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalToolMinor | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical length of the minor axis of an ellipse that describes the size of the approaching tool for the given pointer index.
See getToolMinor() for details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalTouchMajor | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical length of the major axis of an ellipse that describes the touch area for the given pointer index.
See getTouchMajor() for details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalTouchMinor | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical length of the minor axis of an ellipse that describes the touch area for the given pointer index.
See getTouchMinor() for details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalX | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical X-coordinate of this event for the given pointer index.
See getX() for more details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
float getHistoricalY | ( | int | historyIndex, |
int | pointerIndex | ||
) | const |
Get the historical Y-coordinate of this event for the given pointer index.
See getY() for more details.
historyIndex | The index into the event history. |
pointerIndex | The pointer index. |
uint_t getHistorySize | ( | ) | const |
Get the number of historical points in this event.
These are movements that have occurred between this event and the previous event. This only applies to MotionEvent::Action_Move events – all other actions will have a size of 0. Historical samples are indexed from oldest to newest.
uint32_t getMetaState | ( | ) | const |
Get the state of any modifier keys at the time of this event.
See KeyEvent for a collection of bitmasks that may be used to test for individual modifier keys.
float getOrientation | ( | int | pointerIndex | ) | const |
Get the current orientation of the touch area and tool area in radians clockwise from vertical for the given pointer index.
An angle of 0 degrees indicates that the major axis of contact is oriented upwards, is perfectly circular or is of unknown orientation. A positive angle indicates that the major axis of contact is oriented to the right. A negative angle indicates that the major axis of contact is oriented to the left. The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians (finger pointing fully right).
pointerIndex | The pointer index. |
int getPointerCount | ( | ) | const |
Get the number of distinct pointers being reported in this event.
int32_t getPointerID | ( | int | pointerIndex | ) | const |
Get the pointer identifier associated with a particular pointer data index is this event.
The identifier indicates the actual pointer number associated with the data, accounting for individual pointers going up and down since the start of the current gesture.
pointerIndex | The pointer index. |
float getPressure | ( | int | pointerIndex | ) | const |
Get the current pressure of this event for the given pointer index.
The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), however values higher than 1 may be generated depending on the calibration of the input device.
pointerIndex | The pointer index. |
float getRawX | ( | int | pointerIndex | ) | const |
Get the raw X-coordinate of this event for the given pointer index.
For touch events on the screen, this is the original location of the event on the screen, before it had been adjusted for the containing window and views.
pointerIndex | The pointer index. |
float getRawY | ( | int | pointerIndex | ) | const |
Get the raw Y-coordinate of this event for the given pointer index.
For touch events on the screen, this is the original location of the event on the screen, before it had been adjusted for the containing window and views.
pointerIndex | The pointer index. |
float getSize | ( | int | pointerIndex | ) | const |
Get the current scaled value of the approximate size for the given pointer index.
This represents some approximation of the area of the screen being pressed; the actual value in pixels corresponding to the touch is normalized with the device specific range of values and scaled to a value between 0 and 1. The value of size can be used to determine fat touch events.
pointerIndex | The pointer index. |
|
virtualinherited |
Get the source of this event.
float getToolMajor | ( | int | pointerIndex | ) | const |
Get the current length of the major axis of an ellipse that describes the size of the approaching tool for the given pointer index.
The tool area represents the estimated size of the finger or pen that is touching the device independent of its actual touch area at the point of contact.
pointerIndex | The pointer index. |
float getToolMinor | ( | int | pointerIndex | ) | const |
Get the current length of the minor axis of an ellipse that describes the size of the approaching tool for the given pointer index.
The tool area represents the estimated size of the finger or pen that is touching the device independent of its actual touch area at the point of contact.
pointerIndex | The pointer index. |
MotionEvent::ToolType getToolType | ( | int | pointerIndex | ) | const |
Get the tool type of a pointer.
The tool type indicates the type of tool used to make contact, such as a finger or stylus, if known.
pointerIndex | The pointer index. |
float getTouchMajor | ( | int | pointerIndex | ) | const |
Get the current length of the major axis of an ellipse that describes the touch area at the point of contact for the given pointer index.
pointerIndex | The pointer index. |
float getTouchMinor | ( | int | pointerIndex | ) | const |
Get the current length of the minor axis of an ellipse that describes the touch area at the point of contact for the given pointer index.
pointerIndex | The pointer index. |
|
inlineinherited |
Get the event type.
float getX | ( | int | pointerIndex | ) | const |
Get the current X-coordinate of this event for the given pointer index.
Whole numbers are pixels; the value may have a fraction for input devices that are sub-pixel precise.
pointerIndex | The pointer index. |
float getXOffset | ( | ) | const |
Get the X-coordinate offset.
For touch events on the screen, this is the delta that was added to the raw screen coordinates to adjust for the absolute position of the containing windows and views.
float getXPrecision | ( | ) | const |
Get the precision of the X-coordinates being reported.
This value may be multiplied with an X-coordinate sample to find the actual hardware value of the X-coordinate.
float getY | ( | int | pointerIndex | ) | const |
Get the current Y-coordinate of this event for the given pointer index.
Whole numbers are pixels; the value may have a fraction for input devices that are sub-pixel precise.
pointerIndex | The pointer index. |
float getYOffset | ( | ) | const |
Get the Y-coordinate offset.
For touch events on the screen, this is the delta that was added to the raw screen coordinates to adjust for the absolute position of the containing windows and views.
float getYPrecision | ( | ) | const |
Get the precision of the Y-coordinates being reported.
This value may be multiplied with a Y-coordinate sample to find the actual hardware value of the Y-coordinate.
|
static |
A bitmask for testing if the motion event intersected the bottom edge of the screen.
|
static |
A bitmask for testing if the motion event intersected the left edge of the screen.
|
static |
A bitmask for testing if the motion event intersected the right edge of the screen.
|
static |
A bitmask for testing if the motion event intersected the top edge of the screen.
|
static |
A flag indicating that the window that received the event is partially or completely obscured.