Commit 8b3759c8 authored by Juha Manninen's avatar Juha Manninen
Browse files

LCL-GTK2: Support 5 button mice. Issue #32562, patch from accorp.

git-svn-id: trunk@56122 -
parent 136dc9b9
......@@ -3107,6 +3107,7 @@ const
var
IsMultiClick: boolean;
TargetControl: TControl;
Button: Byte;
begin
Result := LM_NULL;
......@@ -3159,10 +3160,16 @@ begin
end;
LastMouse.Down := AMouseDown;
// mouse buttons 4,5 share same messages
if AButton = 5 then
Button := 4
else
Button := AButton;
if AMouseDown then
Result := MSGKINDDOWN[AButton][LastMouse.ClickCount]
Result := MSGKINDDOWN[Button][LastMouse.ClickCount]
else
Result := MSGKINDUP[AButton];
Result := MSGKINDUP[Button];
end;
function GetKeyShiftState: TShiftState;
......
......@@ -2276,11 +2276,11 @@ var
MappedXY: TPoint;
EventXY: TPoint;
function CheckMouseButtonUp(MouseButton, MsgID: longint): boolean;
function CheckMouseButtonUp(MouseButton: longint; BtnShiftState: TShiftStateEnum): boolean;
begin
if MsgID=0 then ;
MessI.Msg := CheckMouseButtonDownUp({%H-}TLCLIntfHandle(widget),
AWinControl, LastMouse, EventXY, MouseButton, False);
Include(ShiftState, BtnShiftState);
Result := True;
end;
......@@ -2299,11 +2299,11 @@ begin
ShiftState := GTKEventStateToShiftState(Event^.State);
case event^.Button of
1: if not CheckMouseButtonUp(1, LM_LBUTTONUP) then Exit;
2: if not CheckMouseButtonUp(3, LM_MBUTTONUP) then Exit;
3: if not CheckMouseButtonUp(2, LM_RBUTTONUP) then exit;
8: if not CheckMouseButtonUp(4, LM_XBUTTONUP) then exit;
9: if not CheckMouseButtonUp(5, LM_XBUTTONUP) then exit;
1: if not CheckMouseButtonUp(1, ssLeft) then Exit;
2: if not CheckMouseButtonUp(3, ssMiddle) then Exit;
3: if not CheckMouseButtonUp(2, ssRight) then Exit;
8: if not CheckMouseButtonUp(4, ssExtra1) then Exit;
9: if not CheckMouseButtonUp(5, ssExtra2) then Exit;
else
begin
MessI.Msg := LM_NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment