mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 02:00:30 +01:00
Carbon: React to horizontal mouse wheel move (Mac trackpad). Issue #29972, patch from AlexeyT.
git-svn-id: trunk@54555 -
This commit is contained in:
parent
38cf175df2
commit
a922238514
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user