summaryrefslogtreecommitdiffstats
path: root/services/inputflinger/InputReader.h
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-05-11 19:52:27 +0100
committerMichael Wright <michaelwr@google.com>2015-05-14 13:25:41 +0100
commit48a8a0e4322969e1551536d6183af3a1faa2240b (patch)
treec30586e4c77090e21da1c3abb05900806059d358 /services/inputflinger/InputReader.h
parent53dca3aadda499824d3d0b2bbc25a72fc1a37877 (diff)
downloadframeworks_native-48a8a0e4322969e1551536d6183af3a1faa2240b.zip
frameworks_native-48a8a0e4322969e1551536d6183af3a1faa2240b.tar.gz
frameworks_native-48a8a0e4322969e1551536d6183af3a1faa2240b.tar.bz2
Add new MotionEvent actions for button press and release.
Introduce ACTION_BUTTON_PRESS and ACTION_BUTTON_RELEASE as actions to signal a button press or release. If these actions happen simulanteously with a DOWN or UP event then they're explicitly ordered to happen after the DOWN or preceding the UP in order to send them to the most recently targeted view. Also, introduce new stylus button constants that differ from the constants we use for mouse buttons. Bug: 20704355 Change-Id: Ib960a5004db5429ad2fc8db020704773e2978327
Diffstat (limited to 'services/inputflinger/InputReader.h')
-rw-r--r--services/inputflinger/InputReader.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/services/inputflinger/InputReader.h b/services/inputflinger/InputReader.h
index ae090c1..4062ec7 100644
--- a/services/inputflinger/InputReader.h
+++ b/services/inputflinger/InputReader.h
@@ -1432,11 +1432,14 @@ protected:
BitSet32 stylusIdBits;
BitSet32 mouseIdBits;
+ int32_t buttonState;
+
void copyFrom(const CookedState& other) {
cookedPointerData.copyFrom(other.cookedPointerData);
fingerIdBits = other.fingerIdBits;
stylusIdBits = other.stylusIdBits;
mouseIdBits = other.mouseIdBits;
+ buttonState = other.buttonState;
}
void clear() {
@@ -1444,6 +1447,7 @@ protected:
fingerIdBits.clear();
stylusIdBits.clear();
mouseIdBits.clear();
+ buttonState = 0;
}
};
@@ -1794,6 +1798,9 @@ private:
void dispatchTouches(nsecs_t when, uint32_t policyFlags);
void dispatchHoverExit(nsecs_t when, uint32_t policyFlags);
void dispatchHoverEnterAndMove(nsecs_t when, uint32_t policyFlags);
+ void dispatchButtonRelease(nsecs_t when, uint32_t policyFlags);
+ void dispatchButtonPress(nsecs_t when, uint32_t policyFlags);
+ const BitSet32& findActiveIdBits(const CookedPointerData& cookedPointerData);
void cookPointerData();
void dispatchPointerUsage(nsecs_t when, uint32_t policyFlags, PointerUsage pointerUsage);
@@ -1824,8 +1831,8 @@ private:
// method will take care of setting the index and transmuting the action to DOWN or UP
// it is the first / last pointer to go down / up.
void dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32_t source,
- int32_t action, int32_t flags, int32_t metaState, int32_t buttonState,
- int32_t edgeFlags,
+ int32_t action, int32_t actionButton,
+ int32_t flags, int32_t metaState, int32_t buttonState, int32_t edgeFlags,
const PointerProperties* properties, const PointerCoords* coords,
const uint32_t* idToIndex, BitSet32 idBits,
int32_t changedId, float xPrecision, float yPrecision, nsecs_t downTime);