public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Balaji, Madhusudhan" <madhusudhan.balaji@intel.com>
To: "Thangaraj, KalaiyarasanX" <kalaiyarasanx.thangaraj@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Bi, Dandan" <dandan.bi@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>,
	"Pethaiyan, Madhan" <madhan.pethaiyan@intel.com>,
	"Esakkithevar, Kathappan" <kathappan.esakkithevar@intel.com>,
	"Balaji, Madhusudhan" <madhusudhan.balaji@intel.com>
Subject: Re: [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel
Date: Thu, 28 Jul 2022 07:43:27 +0000	[thread overview]
Message-ID: <BL1PR11MB5302009171539EF99446687D9C969@BL1PR11MB5302.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220727151406.1334-1-kalaiyarasanx.thangaraj@intel.com>



-----Original Message-----
From: Thangaraj, KalaiyarasanX <kalaiyarasanx.thangaraj@intel.com> 
Sent: Wednesday, July 27, 2022 8:44 PM
To: devel@edk2.groups.io
Cc: Thangaraj, KalaiyarasanX <kalaiyarasanx.thangaraj@intel.com>; Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Pethaiyan, Madhan <madhan.pethaiyan@intel.com>; Esakkithevar, Kathappan <kathappan.esakkithevar@intel.com>; Balaji, Madhusudhan <madhusudhan.balaji@intel.com>
Subject: [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel

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 <dandan.bi@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Madhan Pethaiyan <madhan.pethaiyan@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Cc: Madhusudhan Balaji <madhusudhan.balaji@intel.com>
Signed-off-by: KalaiyarasanX Thangaraj <kalaiyarasanx.thangaraj@intel.com>
Reviewed-by: Madhusudhan Balaji <madhusudhan.balaji@intel.com>
---
 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/VirtualKeyb
+++ oardDxe/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/VirtualKeyb
+++ oardDxe/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


      reply	other threads:[~2022-07-28  7:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 15:14 [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel KalaiyarasanX Thangaraj
2022-07-28  7:43 ` Balaji, Madhusudhan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BL1PR11MB5302009171539EF99446687D9C969@BL1PR11MB5302.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox