From b7105e33382367e2e2d3433edbab9554aa8dfe23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20H=C3=A4user?= <8659494+mhaeuser@users.noreply.github.com> Date: Fri, 19 Mar 2021 00:36:08 +0100 Subject: [PATCH] OcAppleEventLib: Reduce pointer poll frequency for compatibility At least QEMU cannot poll faster than 10 ms. --- Library/OcAppleEventLib/PointerHandler.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Library/OcAppleEventLib/PointerHandler.c b/Library/OcAppleEventLib/PointerHandler.c index d2f3a9a6..dbd7ac4b 100644 --- a/Library/OcAppleEventLib/PointerHandler.c +++ b/Library/OcAppleEventLib/PointerHandler.c @@ -38,12 +38,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include -// POINTER_POLL_FREQUENCY -#define POINTER_POLL_FREQUENCY EFI_TIMER_PERIOD_MILLISECONDS (2) +// +// CHANGE: Apple polls with a frequency of 2 ms, however this is infeasible on +// most machines. Poll with 10 ms, which matches the keyboard behaviour, +// and also is the minimum for QEMU. +// +#define POINTER_POLL_FREQUENCY EFI_TIMER_PERIOD_MILLISECONDS (10) #define MAX_POINTER_POLL_FREQUENCY EFI_TIMER_PERIOD_MILLISECONDS (80) -STATIC UINT16 mMaximumDoubleClickSpeed = 374; -STATIC UINT16 mMaximumClickDuration = 74; +STATIC UINT16 mMaximumDoubleClickSpeed = 38; // 374 for 2 ms +STATIC UINT16 mMaximumClickDuration = 8; // 74 for 2 ms // MINIMAL_MOVEMENT #define MINIMAL_MOVEMENT 5