summaryrefslogtreecommitdiffstats
path: root/services/inputflinger/InputReader.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/inputflinger/InputReader.h')
-rw-r--r--services/inputflinger/InputReader.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/services/inputflinger/InputReader.h b/services/inputflinger/InputReader.h
index 30c84b1..e480350 100644
--- a/services/inputflinger/InputReader.h
+++ b/services/inputflinger/InputReader.h
@@ -144,6 +144,12 @@ struct InputReaderConfiguration {
// The presence of an external stylus has changed.
CHANGE_EXTERNAL_STYLUS_PRESENCE = 1 << 7,
+ // Volume keys rotation option changed.
+ CHANGE_VOLUME_KEYS_ROTATION = 1 << 8,
+
+ // Stylus icon option changed.
+ CHANGE_STYLUS_ICON_ENABLED = 1 << 9,
+
// All devices must be reopened.
CHANGE_MUST_REOPEN = 1 << 31,
};
@@ -231,6 +237,16 @@ struct InputReaderConfiguration {
// True to show the location of touches on the touch screen as spots.
bool showTouches;
+ // True to show the pointer icon when a stylus is used.
+ bool stylusIconEnabled;
+
+ // Ignore finger touches this long after the stylus has been used (including hover)
+ nsecs_t stylusPalmRejectionTime;
+
+ // Remap volume keys according to display rotation
+ // 0 - disabled, 1 - phone or hybrid rotation mode, 2 - tablet rotation mode
+ int volumeKeysRotationMode;
+
InputReaderConfiguration() :
virtualKeyQuietTime(0),
pointerVelocityControlParameters(1.0f, 500.0f, 3000.0f, 3.0f),
@@ -247,7 +263,11 @@ struct InputReaderConfiguration {
pointerGestureSwipeMaxWidthRatio(0.25f),
pointerGestureMovementSpeedRatio(0.8f),
pointerGestureZoomSpeedRatio(0.3f),
- showTouches(false) { }
+ showTouches(false),
+ stylusIconEnabled(false),
+ stylusPalmRejectionTime(50 * 10000000LL), // 50 ms
+ volumeKeysRotationMode(0)
+ { }
bool getDisplayInfo(bool external, DisplayViewport* outViewport) const;
void setDisplayInfo(bool external, const DisplayViewport& viewport);
@@ -1126,7 +1146,8 @@ private:
uint32_t mSource;
int32_t mKeyboardType;
- int32_t mOrientation; // orientation for dpad keys
+ int32_t mRotationMapOffset; // determines if and how volume keys rotate
+ int32_t mOrientation; // orientation for dpad and volume keys
Vector<KeyDown> mKeyDowns; // keys that are down
int32_t mMetaState;
@@ -1295,6 +1316,7 @@ protected:
DEVICE_TYPE_TOUCH_SCREEN,
DEVICE_TYPE_TOUCH_PAD,
DEVICE_TYPE_TOUCH_NAVIGATION,
+ DEVICE_TYPE_GESTURE_SENSOR,
DEVICE_TYPE_POINTER,
};
@@ -1785,6 +1807,9 @@ private:
VelocityControl mPointerVelocityControl;
VelocityControl mWheelXVelocityControl;
VelocityControl mWheelYVelocityControl;
+
+ // The time the stylus event was processed by any TouchInputMapper
+ static nsecs_t mLastStylusTime;
void resetExternalStylus();
void clearStylusDataPendingFlags();
@@ -1851,6 +1876,10 @@ private:
const VirtualKey* findVirtualKeyHit(int32_t x, int32_t y);
static void assignPointerIds(const RawState* last, RawState* current);
+
+ void unfadePointer(PointerControllerInterface::Transition transition);
+
+ bool rejectPalm(nsecs_t when);
};