From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.20996.1658935010958728506 for ; Wed, 27 Jul 2022 08:16:51 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=K3yibKyc; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: kalaiyarasanx.thangaraj@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658935010; x=1690471010; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JIS/woCTDRnABa+6t6aiizrH+Mn7xLsZndNgjBfkjtA=; b=K3yibKycYVs+mIjIlzvsuvGa0elJuvvbnHgbEso1xPo7Db9HLT0f5o4b bjxUhK/fn1ItowjiKspG6szjHdvUTZaoLROj5YwtmJJiRDsY3IdJ9sNFw AmcXmKLK+MwXl7q/jFj2Q79VSkQB7G7rBcI+jA8Epa46ts78oI6TqkQ7U OTxV+rwdtNGM6WReBnSx3piHLE/CqENP9j2xjG2v12Fm/fNZZK87C4DeD e2+NkVya/m3Do2MhYCSE9hJr9vXsiHysgpWN3nH3a3a+XfiWQXrswMJnF jcRDrXmavDFaW1Z/LUfQnsz71I6MzHaBr4GFGp11frneaEXFf0pl3uxQw w==; X-IronPort-AV: E=McAfee;i="6400,9594,10421"; a="349968748" X-IronPort-AV: E=Sophos;i="5.93,195,1654585200"; d="scan'208";a="349968748" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2022 08:14:20 -0700 X-IronPort-AV: E=Sophos;i="5.93,195,1654585200"; d="scan'208";a="659242117" Received: from kalaiy1x-desk1.gar.corp.intel.com ([10.66.253.24]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2022 08:14:17 -0700 From: "KalaiyarasanX Thangaraj" To: devel@edk2.groups.io Cc: KalaiyarasanX Thangaraj , Dandan Bi , Liming Gao , Madhan Pethaiyan , Kathappan Esakkithevar , Madhusudhan Balaji Subject: [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel Date: Wed, 27 Jul 2022 20:44:06 +0530 Message-Id: <20220727151406.1334-1-kalaiyarasanx.thangaraj@intel.com> X-Mailer: git-send-email 2.37.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On one Touch, multiple Reads happend and this reads varying based on Key Press time. Resulting in Multiple key press update on screen. This condition avoids KeyPressed skips resulting due to faster key press and update only on valid key press. Cc: Dandan Bi Cc: Liming Gao Cc: Madhan Pethaiyan Cc: Kathappan Esakkithevar Cc: Madhusudhan Balaji Signed-off-by: KalaiyarasanX Thangaraj --- Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c | 12 ++++++++++++ Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c index 2b1216746b..aa4bfe3baa 100644 --- a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c +++ b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c @@ -512,6 +512,18 @@ VkTimer ( if (!VkContext->TouchActive) { VkContext->KeyPressed = FALSE; } + + // + // On one Touch, multiple Reads happend and this reads varying based on Key Press time. + // Resulting in Multiple key press update on screen. This condition avoids Key Press skips + // resulting due to faster key press and update only on valid key press. + // + if ((Point.CurrentX != PreviousX) || (Point.CurrentY != PreviousY)) { + VkContext->KeyPressed = FALSE; + } + PreviousX = Point.CurrentX; + PreviousY = Point.CurrentY; + ConvertCoordinate (VkContext, Point, &TouchX, &TouchY); if (!VkContext->KeyPressed && diff --git a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h index 14a50fa5af..11e045f894 100644 --- a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h +++ b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h @@ -37,6 +37,9 @@ extern EFI_DRIVER_BINDING_PROTOCOL gVirtualKeyboardDriverBinding; extern EFI_COMPONENT_NAME_PROTOCOL gVirtualKeyboardComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gVirtualKeyboardComponentName2; +GLOBAL_REMOVE_IF_UNREFERENCED UINTN PreviousX; +GLOBAL_REMOVE_IF_UNREFERENCED UINTN PreviousY; + /// /// Debug raw data points /// -- 2.26.2.windows.1