diff --git a/lcl/interfaces/gtk2/gtk2callback.inc b/lcl/interfaces/gtk2/gtk2callback.inc index cf3a8a92df..60001581b3 100644 --- a/lcl/interfaces/gtk2/gtk2callback.inc +++ b/lcl/interfaces/gtk2/gtk2callback.inc @@ -2094,8 +2094,11 @@ var (csDesigning in AWinControl.ComponentState) then exit; - MessI.Msg := CheckMouseButtonDownUp({%H-}TLCLIntfHandle(widget), AWinControl, LastMouse, EventXY, MouseButton, True); + MessI.Msg := CheckMouseButtonDownUp({%H-}TLCLIntfHandle(widget), AWinControl, + LastMouse, EventXY, MouseButton, True); MessI.Keys := MessI.Keys or BtnKey; + if BtnKey in [MK_XBUTTON1, MK_XBUTTON2] then + MessI.Keys := MessI.Keys or BtnKey shl 11; case LastMouse.ClickCount of 2: MessI.Keys := MessI.Keys or MK_DOUBLECLICK; 3: MessI.Keys := MessI.Keys or MK_TRIPLECLICK; @@ -2155,7 +2158,7 @@ begin 2: if not CheckMouseButtonDown(3, MK_MBUTTON) then Exit; 3: if not CheckMouseButtonDown(2, MK_RBUTTON) then Exit; 8: if not CheckMouseButtonDown(4, MK_XBUTTON1) then Exit; - 9: if not CheckMouseButtonDown(4, MK_XBUTTON2) then Exit; + 9: if not CheckMouseButtonDown(5, MK_XBUTTON2) then Exit; else begin MessI.Msg := LM_NULL; @@ -2300,7 +2303,7 @@ begin 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(4, LM_XBUTTONUP) then exit; + 9: if not CheckMouseButtonUp(5, LM_XBUTTONUP) then exit; else begin MessI.Msg := LM_NULL;