--------- Reviewed-by:Balaji, Madhusudhan madhusudhan.bal...@intel.com<mailto:madhusudhan.bal...@intel.com>
-------------- From: Thangaraj, KalaiyarasanX <kalaiyarasanx.thanga...@intel.com> Sent: Tuesday, August 2, 2022 2:49 PM To: devel@edk2.groups.io Cc: Thangaraj, KalaiyarasanX <kalaiyarasanx.thanga...@intel.com>; Bi, Dandan <dandan...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn>; Pethaiyan, Madhan <madhan.pethai...@intel.com>; Esakkithevar, Kathappan <kathappan.esakkithe...@intel.com>; Balaji, Madhusudhan <madhusudhan.bal...@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...@intel.com<mailto:dandan...@intel.com> Cc: Liming Gao gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn> Cc: Madhan Pethaiyan madhan.pethai...@intel.com<mailto:madhan.pethai...@intel.com> Cc: Kathappan Esakkithevar kathappan.esakkithe...@intel.com<mailto:kathappan.esakkithe...@intel.com> Cc: Madhusudhan Balaji madhusudhan.bal...@intel.com<mailto:madhusudhan.bal...@intel.com> Signed-off-by: KalaiyarasanX Thangaraj kalaiyarasanx.thanga...@intel.com<mailto:kalaiyarasanx.thanga...@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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92062): https://edk2.groups.io/g/devel/message/92062 Mute This Topic: https://groups.io/mt/92766964/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-