[edk2-devel] [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel

KalaiyarasanX Thangaraj posted 1 patch 2 weeks, 1 day ago
Failed in applying to current master (apply log)
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/Keyboard.c        | 12 ++++++++++++
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboard.h |  3 +++
2 files changed, 15 insertions(+)
[edk2-devel] [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel
Posted by KalaiyarasanX Thangaraj 2 weeks, 1 day ago
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>
---
 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91896): https://edk2.groups.io/g/devel/message/91896
Mute This Topic: https://groups.io/mt/92651285/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] VirtualKeyboardFeaturePkg: Pre OS virtual keyboard touch response are very slow with I2C touch panel
Posted by Balaji, Madhusudhan 2 weeks ago

-----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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91945): https://edk2.groups.io/g/devel/message/91945
Mute This Topic: https://groups.io/mt/92651285/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-