mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 12:39:18 +02:00
win32: apply patch of Martin Friebe which allows triple and quad-mouse-click action for windows (only for left mouse button though) #0012767
git-svn-id: trunk@17742 -
This commit is contained in:
parent
ebfa9fcc57
commit
4bd4fa8fb0
@ -1673,9 +1673,18 @@ begin
|
|||||||
begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
|
// always within the time-window
|
||||||
|
if (MouseDownCount < 1) or (MouseDownCount > 4) then MouseDownCount := 1;
|
||||||
|
inc(MouseDownCount);
|
||||||
|
MouseDownTime := GetTickCount;
|
||||||
with LMMouse Do
|
with LMMouse Do
|
||||||
begin
|
begin
|
||||||
Msg := LM_LBUTTONDBLCLK;
|
case MouseDownCount of
|
||||||
|
2: Msg := LM_LBUTTONDBLCLK;
|
||||||
|
3: Msg := LM_LBUTTONTRIPLECLK;
|
||||||
|
4: Msg := LM_LBUTTONQUADCLK;
|
||||||
|
else Msg := LM_LBUTTONDOWN;
|
||||||
|
end;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
@ -1687,14 +1696,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
WM_LBUTTONDOWN:
|
WM_LBUTTONDOWN:
|
||||||
begin
|
begin
|
||||||
|
if (MouseDownCount < 1) or (MouseDownCount > 4) then MouseDownCount := 1;
|
||||||
// if mouse-click, focus-change, mouse-click, cursor hasn't moved:
|
// if mouse-click, focus-change, mouse-click, cursor hasn't moved:
|
||||||
// simulate double click, assume focus change due to first mouse-click
|
// simulate double click, assume focus change due to first mouse-click
|
||||||
if (MouseDownFocusStatus = mfFocusChanged) and (MouseDownFocusWindow = Window)
|
if (MouseDownFocusStatus = mfFocusChanged) and (MouseDownFocusWindow = Window)
|
||||||
and (GetTickCount - MouseDownTime <= GetDoubleClickTime)
|
and (GetTickCount - MouseDownTime <= GetDoubleClickTime)
|
||||||
and CheckMouseMovement then
|
and CheckMouseMovement then
|
||||||
begin
|
begin
|
||||||
|
inc(MouseDownCount);
|
||||||
PostMessage(Window, WM_LBUTTONDBLCLK, WParam, LParam);
|
PostMessage(Window, WM_LBUTTONDBLCLK, WParam, LParam);
|
||||||
end;
|
end
|
||||||
|
else if (MouseDownWindow = Window)
|
||||||
|
and (GetTickCount - MouseDownTime <= GetDoubleClickTime)
|
||||||
|
and CheckMouseMovement then
|
||||||
|
inc(MouseDownCount)
|
||||||
|
else
|
||||||
|
MouseDownCount := 1;
|
||||||
|
|
||||||
MouseDownTime := GetTickCount;
|
MouseDownTime := GetTickCount;
|
||||||
MouseDownWindow := Window;
|
MouseDownWindow := Window;
|
||||||
@ -1705,7 +1722,12 @@ begin
|
|||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
with LMMouse Do
|
with LMMouse Do
|
||||||
begin
|
begin
|
||||||
Msg := LM_LBUTTONDOWN;
|
case MouseDownCount of
|
||||||
|
2: Msg := LM_LBUTTONDBLCLK;
|
||||||
|
3: Msg := LM_LBUTTONTRIPLECLK;
|
||||||
|
4: Msg := LM_LBUTTONQUADCLK;
|
||||||
|
else Msg := LM_LBUTTONDOWN;
|
||||||
|
end;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
|
@ -295,6 +295,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
MouseDownCount: Integer;
|
||||||
MouseDownTime: dword;
|
MouseDownTime: dword;
|
||||||
MouseDownPos: TPoint;
|
MouseDownPos: TPoint;
|
||||||
MouseDownWindow: HWND = 0;
|
MouseDownWindow: HWND = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user