From 956c0fb2386cb0cf92e08b199c706ed3a044ad1b Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Fri, 1 Oct 2010 14:55:30 -0700 Subject: Support haptic feedback for virtual keys defined in key layout. Change-Id: I83e4108a87332692e03791dc066206becbc7941f --- libs/ui/InputReader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libs/ui') diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp index 1d35e10..825febc 100644 --- a/libs/ui/InputReader.cpp +++ b/libs/ui/InputReader.cpp @@ -993,7 +993,10 @@ void KeyboardInputMapper::applyPolicyAndDispatch(nsecs_t when, uint32_t policyFl int32_t keyEventAction = down ? AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP; int32_t keyEventFlags = AKEY_EVENT_FLAG_FROM_SYSTEM; if (policyFlags & POLICY_FLAG_WOKE_HERE) { - keyEventFlags = keyEventFlags | AKEY_EVENT_FLAG_WOKE_HERE; + keyEventFlags |= AKEY_EVENT_FLAG_WOKE_HERE; + } + if (policyFlags & POLICY_FLAG_VIRTUAL) { + keyEventFlags |= AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY; } getDispatcher()->notifyKey(when, getDeviceId(), AINPUT_SOURCE_KEYBOARD, policyFlags, @@ -2162,10 +2165,7 @@ void TouchInputMapper::applyPolicyAndDispatchVirtualKey(nsecs_t when, uint32_t p int32_t keyCode, int32_t scanCode, nsecs_t downTime) { int32_t metaState = mContext->getGlobalMetaState(); - if (keyEventAction == AKEY_EVENT_ACTION_DOWN) { - getPolicy()->virtualKeyDownFeedback(); - } - + policyFlags |= POLICY_FLAG_VIRTUAL; int32_t policyActions = getPolicy()->interceptKey(when, getDeviceId(), keyEventAction == AKEY_EVENT_ACTION_DOWN, keyCode, scanCode, policyFlags); -- cgit v1.1