Carbon: React to horizontal mouse wheel move (Mac trackpad). Issue #29972, patch from AlexeyT.

git-svn-id: trunk@54555 -
This commit is contained in:
juha 2017-04-07 09:47:38 +00:00
parent 38cf175df2
commit a922238514

View File

@ -85,6 +85,19 @@ const
Result:=Widget.LCLObject.ScreenToClient(Mouse.CursorPos);
end;
function GetMouseWheelAxisHorz: boolean;
var
Val: EventMouseWheelAxis;
begin
Result := False;
if OSError(
GetEventParameter(AEvent, kEventParamMouseWheelAxis, typeMouseWheelAxis, nil,
SizeOf(Val), nil, @Val),
SName, SGetEvent, 'kEventParamMouseWheelAxis') then Exit;
Result := Val=kEventMouseWheelAxisX;
end;
function GetMouseWheelDelta: Integer;
var
WheelDelta: SInt32;
@ -232,6 +245,8 @@ const
Msg^.Y := MousePoint.Y;
Msg^.State := GetCarbonShiftState;
Msg^.WheelDelta := GetMouseWheelDelta;
if GetMouseWheelAxisHorz then
Include(Msg^.State, ssExtra1);
end;
var