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 2] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel
Date: Tue, 2 Aug 2022 17:01:39 +0000	[thread overview]
Message-ID: <BL1PR11MB5302F0E02D287A4398775A139C9D9@BL1PR11MB5302.namprd11.prod.outlook.com> (raw)
In-Reply-To: <DM6PR11MB253990F6CFF00BE48250921EEC9D9@DM6PR11MB2539.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3673 bytes --]

---------

Reviewed-by:Balaji, Madhusudhan madhusudhan.balaji@intel.com<mailto:madhusudhan.balaji@intel.com>

--------------

From: Thangaraj, KalaiyarasanX <kalaiyarasanx.thangaraj@intel.com>
Sent: Tuesday, August 2, 2022 2:49 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 2] 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<mailto:dandan.bi@intel.com>
Cc: Liming Gao gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>
Cc: Madhan Pethaiyan madhan.pethaiyan@intel.com<mailto:madhan.pethaiyan@intel.com>
Cc: Kathappan Esakkithevar kathappan.esakkithevar@intel.com<mailto:kathappan.esakkithevar@intel.com>
Cc: Madhusudhan Balaji madhusudhan.balaji@intel.com<mailto:madhusudhan.balaji@intel.com>
Signed-off-by: KalaiyarasanX Thangaraj kalaiyarasanx.thangaraj@intel.com<mailto:kalaiyarasanx.thangaraj@intel.com>
---
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c        | 12 ++++++++++++
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h |  6 ++++++
2 files changed, 18 insertions(+)

diff --git a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c
index 2b1216746b..8c9d5b9a86 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 != VkContext->PreviousX) || (Point.CurrentY != VkContext->PreviousY)) {
+     VkContext->KeyPressed = FALSE;
+  }
+  VkContext->PreviousX = Point.CurrentX;
+  VkContext->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..7090730861 100644
--- a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h
+++ b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h
@@ -373,6 +373,12 @@ struct _VK_CONTEXT {
   BOOLEAN                           IsRedrawUpdateUI;
   VK_PAGE_TYPE                      PageNumber;
   LIST_ENTRY                        NotifyList;
+
+  ///
+  /// Previous X and Y axis Buffer
+  ///
+  UINTN                             PreviousX;
+  UINTN                             PreviousY;
};

 ///
--
2.26.2.windows.1

[-- Attachment #2: Type: text/html, Size: 10320 bytes --]

  reply	other threads:[~2022-08-02 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  9:18 [PATCH 2] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel KalaiyarasanX Thangaraj
2022-08-02 17:01 ` Balaji, Madhusudhan [this message]
2022-08-03  1:50   ` Dandan Bi

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=BL1PR11MB5302F0E02D287A4398775A139C9D9@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