From c9aa628d065eb08d6fa30f0ac21c6eca4cfbab75 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Wed, 11 Feb 2015 19:03:28 -0800 Subject: Cancel touch events when a low-level touch gesture occurs. When the touch firmware or driver sends a key event that is triggered by a low-level gesture such as a palm slap. For this to work, the touch device's .kl file must specify the "GESTURE" flag for each key that is produced by a gesture. Note that the "VIRTUAL" flag should also be specified for any such keys for which we would like to generate haptic feedback. eg. key 142 SLEEP VIRTUAL GESTURE Bug: 19264992 Change-Id: Ief494ec7e3ca66d2358a1001fdfae4f263ee1cd1 --- include/input/Input.h | 12 ++++++++++++ include/input/InputEventLabels.h | 1 + 2 files changed, 13 insertions(+) (limited to 'include/input') diff --git a/include/input/Input.h b/include/input/Input.h index 96b6885..c360f63 100644 --- a/include/input/Input.h +++ b/include/input/Input.h @@ -149,10 +149,22 @@ enum { * NOTE: If you want a flag to be able to set in a keylayout file, then you must add it to * InputEventLabels.h as well. */ + // Indicates that the event should wake the device. POLICY_FLAG_WAKE = 0x00000001, + + // Indicates that the key is virtual, such as a capacitive button, and should + // generate haptic feedback. Virtual keys may be suppressed for some time + // after a recent touch to prevent accidental activation of virtual keys adjacent + // to the touch screen during an edge swipe. POLICY_FLAG_VIRTUAL = 0x00000002, + + // Indicates that the key is the special function modifier. POLICY_FLAG_FUNCTION = 0x00000004, + // Indicates that the key represents a special gesture that has been detected by + // the touch firmware or driver. Causes touch events from the same device to be canceled. + POLICY_FLAG_GESTURE = 0x00000008, + POLICY_FLAG_RAW_MASK = 0x0000ffff, /* These flags are set by the input dispatcher. */ diff --git a/include/input/InputEventLabels.h b/include/input/InputEventLabels.h index df50237..9aa7425 100644 --- a/include/input/InputEventLabels.h +++ b/include/input/InputEventLabels.h @@ -376,6 +376,7 @@ static const InputEventLabel LEDS[] = { static const InputEventLabel FLAGS[] = { DEFINE_FLAG(VIRTUAL), DEFINE_FLAG(FUNCTION), + DEFINE_FLAG(GESTURE), { NULL, 0 } }; -- cgit v1.1