From ea3cda979101d1028671f00ed37c998893abbcd4 Mon Sep 17 00:00:00 2001 From: dmitry Date: Wed, 28 Aug 2019 02:26:38 +0000 Subject: [PATCH] cocoa: correct horizontal scrollWheel. macOS and LCL are using reversed delta values git-svn-id: trunk@61770 - --- lcl/interfaces/cocoa/cocoawscommon.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/cocoa/cocoawscommon.pas b/lcl/interfaces/cocoa/cocoawscommon.pas index bae9aac653..2487bc0547 100644 --- a/lcl/interfaces/cocoa/cocoawscommon.pas +++ b/lcl/interfaces/cocoa/cocoawscommon.pas @@ -1161,7 +1161,10 @@ begin if event.deltaX <> 0 then begin Msg.Msg := LM_MOUSEHWHEEL; - Msg.WheelDelta := round(event.deltaX * 120); + // see "deltaX" documentation. + // on macOS: -1 = right, +1 = left + // on LCL: -1 = left, +1 = right + Msg.WheelDelta := round(-event.deltaX * 120); end else // Filter out empty events - See bug 28491