diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-10-24 14:39:33 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-01-11 20:56:04 -0800 |
commit | 6f71d0fedbb04c048a7294976103e42f0f046641 (patch) | |
tree | 134e67a8de24e3cba2eafeea87f486342537b576 /include | |
parent | 7e2f9cc81da788006790365ff11f06551fc1bc26 (diff) | |
download | frameworks_base-6f71d0fedbb04c048a7294976103e42f0f046641.zip frameworks_base-6f71d0fedbb04c048a7294976103e42f0f046641.tar.gz frameworks_base-6f71d0fedbb04c048a7294976103e42f0f046641.tar.bz2 |
Filter virtual keys after touches. (DO NOT MERGE)
Adds a new virtualKeyQuietTimeMillis configuration resource that sets
the duration for which virtual keys will be dropped after recent touches
on screen. The default value is 0; it is intended to be overridden
per device using a resource overlay.
This change is designed to help in two cases:
1. Swipes from touchscreen into virtual key area.
2. Accidental taps in virtual key area while using on-screen keyboard.
Bug: 3089163
Change-Id: Id6733c83c2e2bc8d9553aa0e5c1fd74b741bec6e
Diffstat (limited to 'include')
-rw-r--r-- | include/ui/InputReader.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/ui/InputReader.h b/include/ui/InputReader.h index 49351b0..7568ba7 100644 --- a/include/ui/InputReader.h +++ b/include/ui/InputReader.h @@ -103,6 +103,12 @@ public: */ virtual bool filterJumpyTouchEvents() = 0; + /* Gets the amount of time to disable virtual keys after the screen is touched + * in order to filter out accidental virtual key presses due to swiping gestures + * or taps near the edge of the display. May be 0 to disable the feature. + */ + virtual nsecs_t getVirtualKeyQuietTime() = 0; + /* Gets the configured virtual key definitions for an input device. */ virtual void getVirtualKeyDefinitions(const String8& deviceName, Vector<VirtualKeyDefinition>& outVirtualKeyDefinitions) = 0; @@ -177,6 +183,10 @@ public: virtual void updateGlobalMetaState() = 0; virtual int32_t getGlobalMetaState() = 0; + virtual void disableVirtualKeysUntil(nsecs_t time) = 0; + virtual bool shouldDropVirtualKey(nsecs_t now, + InputDevice* device, int32_t keyCode, int32_t scanCode) = 0; + virtual InputReaderPolicyInterface* getPolicy() = 0; virtual InputDispatcherInterface* getDispatcher() = 0; virtual EventHubInterface* getEventHub() = 0; @@ -264,6 +274,11 @@ private: InputConfiguration mInputConfiguration; void updateInputConfiguration(); + nsecs_t mDisableVirtualKeysTimeout; + virtual void disableVirtualKeysUntil(nsecs_t time); + virtual bool shouldDropVirtualKey(nsecs_t now, + InputDevice* device, int32_t keyCode, int32_t scanCode); + // state queries typedef int32_t (InputDevice::*GetStateFunc)(uint32_t sourceMask, int32_t code); int32_t getState(int32_t deviceId, uint32_t sourceMask, int32_t code, @@ -585,6 +600,7 @@ protected: bool useBadTouchFilter; bool useJumpyTouchFilter; bool useAveragingTouchFilter; + nsecs_t virtualKeyQuietTime; } mParameters; // Immutable calibration parameters in parsed form. @@ -810,6 +826,7 @@ private: void dispatchTouch(nsecs_t when, uint32_t policyFlags, TouchData* touch, BitSet32 idBits, uint32_t changedId, uint32_t pointerCount, int32_t motionEventAction); + void detectGestures(nsecs_t when); bool isPointInsideSurfaceLocked(int32_t x, int32_t y); const VirtualKey* findVirtualKeyHitLocked(int32_t x, int32_t y); |