mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 22:19:09 +02:00
lcl: add more extra mouse buttons support
git-svn-id: trunk@20536 -
This commit is contained in:
parent
52202a4550
commit
8140fd8755
@ -132,7 +132,7 @@ type
|
||||
|
||||
TBevelCut = TGraphicsBevelCut;
|
||||
|
||||
TMouseButton = (mbLeft, mbRight, mbMiddle);
|
||||
TMouseButton = (mbLeft, mbRight, mbMiddle, mbExtra1, mbExtra2);
|
||||
|
||||
const
|
||||
fsAllStayOnTop = [fsStayOnTop, fsSplash];
|
||||
@ -1031,22 +1031,28 @@ type
|
||||
// protected messages
|
||||
procedure WMCancelMode(var Message: TLMessage); message LM_CANCELMODE;
|
||||
procedure WMContextMenu(var Message: TLMMouse); message LM_CONTEXTMENU;
|
||||
|
||||
procedure WMLButtonDown(var Message: TLMLButtonDown); message LM_LBUTTONDOWN;
|
||||
procedure WMRButtonDown(var Message: TLMRButtonDown); message LM_RBUTTONDOWN;
|
||||
procedure WMMButtonDown(var Message: TLMMButtonDown); message LM_MBUTTONDOWN;
|
||||
procedure WMXButtonDown(var Message: TLMXButtonDown); message LM_XBUTTONDOWN;
|
||||
procedure WMLButtonDBLCLK(var Message: TLMLButtonDblClk); message LM_LBUTTONDBLCLK;
|
||||
procedure WMRButtonDBLCLK(var Message: TLMRButtonDblClk); message LM_RBUTTONDBLCLK;
|
||||
procedure WMMButtonDBLCLK(var Message: TLMMButtonDblClk); message LM_MBUTTONDBLCLK;
|
||||
procedure WMXButtonDBLCLK(var Message: TLMXButtonDblClk); message LM_XBUTTONDBLCLK;
|
||||
procedure WMLButtonTripleCLK(var Message: TLMLButtonTripleClk); message LM_LBUTTONTRIPLECLK;
|
||||
procedure WMRButtonTripleCLK(var Message: TLMRButtonTripleClk); message LM_RBUTTONTRIPLECLK;
|
||||
procedure WMMButtonTripleCLK(var Message: TLMMButtonTripleClk); message LM_MBUTTONTRIPLECLK;
|
||||
procedure WMXButtonTripleCLK(var Message: TLMXButtonTripleClk); message LM_XBUTTONTRIPLECLK;
|
||||
procedure WMLButtonQuadCLK(var Message: TLMLButtonQuadClk); message LM_LBUTTONQUADCLK;
|
||||
procedure WMRButtonQuadCLK(var Message: TLMRButtonQuadClk); message LM_RBUTTONQUADCLK;
|
||||
procedure WMMButtonQuadCLK(var Message: TLMMButtonQuadClk); message LM_MBUTTONQUADCLK;
|
||||
procedure WMXButtonQuadCLK(var Message: TLMXButtonQuadClk); message LM_XBUTTONQUADCLK;
|
||||
procedure WMMouseMove(var Message: TLMMouseMove); message LM_MOUSEMOVE;
|
||||
procedure WMLButtonUp(var Message: TLMLButtonUp); message LM_LBUTTONUP;
|
||||
procedure WMRButtonUp(var Message: TLMRButtonUp); message LM_RBUTTONUP;
|
||||
procedure WMMButtonUp(var Message: TLMMButtonUp); message LM_MBUTTONUP;
|
||||
procedure WMXButtonUp(var Message: TLMXButtonUp); message LM_XBUTTONUP;
|
||||
procedure WMMouseWheel(var Message: TLMMouseEvent); message LM_MOUSEWHEEL;
|
||||
procedure WMMove(var Message: TLMMove); message LM_MOVE;
|
||||
procedure WMSize(var Message: TLMSize); message LM_SIZE;
|
||||
|
27
lcl/forms.pp
27
lcl/forms.pp
@ -1467,6 +1467,7 @@ type
|
||||
|
||||
function KeysToShiftState(Keys: Word): TShiftState;
|
||||
function KeyDataToShiftState(KeyData: Longint): TShiftState;
|
||||
function ShiftStateToKeys(ShiftState: TShiftState): Word;
|
||||
|
||||
function WindowStateToStr(const State: TWindowState): string;
|
||||
function StrToWindowState(const Name: string): TWindowState;
|
||||
@ -1615,12 +1616,14 @@ end;}
|
||||
function KeysToShiftState(Keys:Word): TShiftState;
|
||||
begin
|
||||
Result := [];
|
||||
if Keys and MK_Shift <> 0 then Include(Result,ssShift);
|
||||
if Keys and MK_Control <> 0 then Include(Result,ssCtrl);
|
||||
if Keys and MK_LButton <> 0 then Include(Result,ssLeft);
|
||||
if Keys and MK_RButton <> 0 then Include(Result,ssRight);
|
||||
if Keys and MK_MButton <> 0 then Include(Result,ssMiddle);
|
||||
if GetKeyState(VK_MENU) < 0 then Include(Result,ssAlt);
|
||||
if Keys and MK_Shift <> 0 then Include(Result, ssShift);
|
||||
if Keys and MK_Control <> 0 then Include(Result, ssCtrl);
|
||||
if Keys and MK_LButton <> 0 then Include(Result, ssLeft);
|
||||
if Keys and MK_RButton <> 0 then Include(Result, ssRight);
|
||||
if Keys and MK_MButton <> 0 then Include(Result, ssMiddle);
|
||||
if Keys and MK_XBUTTON1 <> 0 then Include(Result, ssExtra1);
|
||||
if Keys and MK_XBUTTON2 <> 0 then Include(Result, ssExtra2);
|
||||
if GetKeyState(VK_MENU) < 0 then Include(Result, ssAlt);
|
||||
end;
|
||||
|
||||
function KeyDataToShiftState(KeyData: Longint): TShiftState;
|
||||
@ -1628,6 +1631,18 @@ begin
|
||||
Result := MsgKeyDataToShiftState(KeyData);
|
||||
end;
|
||||
|
||||
function ShiftStateToKeys(ShiftState: TShiftState): Word;
|
||||
begin
|
||||
Result := 0;
|
||||
if ssShift in ShiftState then Result := Result or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then Result := Result or MK_CONTROL;
|
||||
if ssLeft in ShiftState then Result := Result or MK_LBUTTON;
|
||||
if ssRight in ShiftState then Result := Result or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then Result := Result or MK_MBUTTON;
|
||||
if ssExtra1 in ShiftState then Result := Result or MK_XBUTTON1;
|
||||
if ssExtra2 in ShiftState then Result := Result or MK_XBUTTON2;
|
||||
end;
|
||||
|
||||
function WindowStateToStr(const State: TWindowState): string;
|
||||
begin
|
||||
Result:=GetEnumName(TypeInfo(TWindowState),ord(State));
|
||||
|
@ -1808,6 +1808,29 @@ begin
|
||||
DoMouseDown(Message, mbMiddle, []);
|
||||
end;
|
||||
|
||||
procedure TControl.WMXButtonDown(var Message: TLMXButtonDown);
|
||||
var
|
||||
Btn: TMouseButton;
|
||||
begin
|
||||
if (Message.Keys and MK_XBUTTON1) <> 0 then
|
||||
Btn := mbExtra1
|
||||
else
|
||||
if (Message.Keys and MK_XBUTTON2) <> 0 then
|
||||
Btn := mbExtra2
|
||||
else
|
||||
Exit;
|
||||
DoBeforeMouseMessage;
|
||||
if (csCaptureMouse in ControlStyle) and (Btn in CaptureMouseButtons) then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLn('TControl.WMXButtonDown ',Name,':',ClassName);
|
||||
{$ENDIF}
|
||||
MouseCapture := True;
|
||||
end;
|
||||
|
||||
DoMouseDown(Message, Btn, []);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TControl.WMLButtonDblClk
|
||||
Params: Message
|
||||
@ -1872,6 +1895,28 @@ begin
|
||||
DoMouseDown(Message, mbMiddle ,[ssDouble]);
|
||||
end;
|
||||
|
||||
procedure TControl.WMXButtonDBLCLK(var Message: TLMXButtonDblClk);
|
||||
var
|
||||
Btn: TMouseButton;
|
||||
begin
|
||||
if (Message.Keys and MK_XBUTTON1) <> 0 then
|
||||
Btn := mbExtra1
|
||||
else
|
||||
if (Message.Keys and MK_XBUTTON2) <> 0 then
|
||||
Btn := mbExtra2
|
||||
else
|
||||
Exit;
|
||||
DoBeforeMouseMessage;
|
||||
if (csCaptureMouse in ControlStyle) and (Btn in CaptureMouseButtons) then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLn('TControl.WMXButtonDblClk ',Name,':',ClassName);
|
||||
{$ENDIF}
|
||||
MouseCapture := True;
|
||||
end;
|
||||
DoMouseDown(Message, Btn, [ssDouble]);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TControl.WMLButtonTripleClk
|
||||
Params: Message
|
||||
@ -1934,6 +1979,28 @@ begin
|
||||
DoMouseDown(Message, mbMiddle ,[ssTriple]);
|
||||
end;
|
||||
|
||||
procedure TControl.WMXButtonTripleCLK(var Message: TLMXButtonTripleClk);
|
||||
var
|
||||
Btn: TMouseButton;
|
||||
begin
|
||||
if (Message.Keys and MK_XBUTTON1) <> 0 then
|
||||
Btn := mbExtra1
|
||||
else
|
||||
if (Message.Keys and MK_XBUTTON2) <> 0 then
|
||||
Btn := mbExtra2
|
||||
else
|
||||
Exit;
|
||||
DoBeforeMouseMessage;
|
||||
if (csCaptureMouse in ControlStyle) and (Btn in CaptureMouseButtons) then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLn('TControl.WMXButtonTripleClk ',Name,':',ClassName);
|
||||
{$ENDIF}
|
||||
MouseCapture := True;
|
||||
end;
|
||||
DoMouseDown(Message, Btn, [ssTriple]);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TControl.WMLButtonQuadClk
|
||||
Params: Message
|
||||
@ -1996,6 +2063,28 @@ begin
|
||||
DoMouseDown(Message, mbMiddle ,[ssQuad]);
|
||||
end;
|
||||
|
||||
procedure TControl.WMXButtonQuadCLK(var Message: TLMXButtonQuadClk);
|
||||
var
|
||||
Btn: TMouseButton;
|
||||
begin
|
||||
if (Message.Keys and MK_XBUTTON1) <> 0 then
|
||||
Btn := mbExtra1
|
||||
else
|
||||
if (Message.Keys and MK_XBUTTON2) <> 0 then
|
||||
Btn := mbExtra2
|
||||
else
|
||||
Exit;
|
||||
DoBeforeMouseMessage;
|
||||
if (csCaptureMouse in ControlStyle) and (Btn in CaptureMouseButtons) then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLn('TControl.WMMButtonQuadClk ',Name,':',ClassName);
|
||||
{$ENDIF}
|
||||
MouseCapture := True;
|
||||
end;
|
||||
DoMouseDown(Message, Btn, [ssQuad]);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TControl.WMLButtonUp
|
||||
Params: Message
|
||||
@ -2075,6 +2164,29 @@ begin
|
||||
DoMouseUp(Message, mbMiddle);
|
||||
end;
|
||||
|
||||
procedure TControl.WMXButtonUp(var Message: TLMXButtonUp);
|
||||
var
|
||||
Btn: TMouseButton;
|
||||
begin
|
||||
if (Message.Keys and MK_XBUTTON1) <> 0 then
|
||||
Btn := mbExtra1
|
||||
else
|
||||
if (Message.Keys and MK_XBUTTON2) <> 0 then
|
||||
Btn := mbExtra2
|
||||
else
|
||||
Exit;
|
||||
DoBeforeMouseMessage;
|
||||
if (csCaptureMouse in ControlStyle) and (Btn in CaptureMouseButtons) then
|
||||
begin
|
||||
{$IFDEF VerboseMouseCapture}
|
||||
DebugLn('TControl.WMMButtonUp ',Name,':',ClassName);
|
||||
{$ENDIF}
|
||||
MouseCapture := False;
|
||||
end;
|
||||
|
||||
DoMouseUp(Message, Btn);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TControl.WMMouseWheel
|
||||
Params: Msg: The message
|
||||
|
@ -1144,14 +1144,7 @@ begin
|
||||
XPos := MappedXY.X;
|
||||
YPos := MappedXY.Y;
|
||||
|
||||
Keys := 0;
|
||||
if ssShift in ShiftState then Keys := Keys or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then Keys := Keys or MK_CONTROL;
|
||||
if ssLeft in ShiftState then Keys := Keys or MK_LBUTTON;
|
||||
if ssRight in ShiftState then Keys := Keys or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then Keys := Keys or MK_MBUTTON;
|
||||
if ssExtra1 in ShiftState then Keys := Keys or MK_XBUTTON1;
|
||||
if ssExtra2 in ShiftState then Keys := Keys or MK_XBUTTON2;
|
||||
Keys := ShiftStateToKeys(ShiftState);
|
||||
|
||||
Result := 0;
|
||||
end;
|
||||
@ -1477,13 +1470,7 @@ begin
|
||||
MessI.XPos := MappedXY.X;
|
||||
MessI.YPos := MappedXY.Y;
|
||||
|
||||
if ssShift in ShiftState then MessI.Keys := MessI.Keys or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then MessI.Keys := MessI.Keys or MK_CONTROL;
|
||||
if ssLeft in ShiftState then MessI.Keys := MessI.Keys or MK_LBUTTON;
|
||||
if ssRight in ShiftState then MessI.Keys := MessI.Keys or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then MessI.Keys := MessI.Keys or MK_MBUTTON;
|
||||
if ssExtra1 in ShiftState then MessI.Keys := MessI.Keys or MK_XBUTTON1;
|
||||
if ssExtra2 in ShiftState then MessI.Keys := MessI.Keys or MK_XBUTTON2;
|
||||
MessI.Keys := ShiftStateToKeys(ShiftState);
|
||||
|
||||
MessI.Result:=0;
|
||||
// send the message directly to the LCL
|
||||
@ -1715,14 +1702,7 @@ begin
|
||||
MessI.YPos := MappedXY.Y;
|
||||
|
||||
ShiftState := GTKEventStateToShiftState(Event^.State);
|
||||
MessI.Keys := 0;
|
||||
if ssShift in ShiftState then MessI.Keys := MessI.Keys or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then MessI.Keys := MessI.Keys or MK_CONTROL;
|
||||
if ssLeft in ShiftState then MessI.Keys := MessI.Keys or MK_LBUTTON;
|
||||
if ssRight in ShiftState then MessI.Keys := MessI.Keys or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then MessI.Keys := MessI.Keys or MK_MBUTTON;
|
||||
if ssExtra1 in ShiftState then MessI.Keys := MessI.Keys or MK_XBUTTON1;
|
||||
if ssExtra2 in ShiftState then MessI.Keys := MessI.Keys or MK_XBUTTON2;
|
||||
MessI.Keys := ShiftStateToKeys(ShiftState);
|
||||
|
||||
if MessI.Msg <> LM_NULL then
|
||||
begin
|
||||
|
@ -1839,6 +1839,42 @@ begin
|
||||
Keys := WParam;
|
||||
end;
|
||||
end;
|
||||
WM_XBUTTONDBLCLK:
|
||||
begin
|
||||
NotifyUserInput := True;
|
||||
PLMsg:=@LMMouse;
|
||||
with LMMouse Do
|
||||
begin
|
||||
Msg := LM_XBUTTONDBLCLK;
|
||||
XPos := GET_X_LPARAM(LParam);
|
||||
YPos := GET_Y_LPARAM(LParam);
|
||||
Keys := WParam;
|
||||
end;
|
||||
end;
|
||||
WM_XBUTTONDOWN:
|
||||
begin
|
||||
NotifyUserInput := True;
|
||||
PLMsg:=@LMMouse;
|
||||
with LMMouse Do
|
||||
begin
|
||||
Msg := LM_XBUTTONDOWN;
|
||||
XPos := GET_X_LPARAM(LParam);
|
||||
YPos := GET_Y_LPARAM(LParam);
|
||||
Keys := WParam;
|
||||
end;
|
||||
end;
|
||||
WM_XBUTTONUP:
|
||||
begin
|
||||
NotifyUserInput := True;
|
||||
PLMsg:=@LMMouse;
|
||||
with LMMouse Do
|
||||
begin
|
||||
Msg := LM_XBUTTONUP;
|
||||
XPos := GET_X_LPARAM(LParam);
|
||||
YPos := GET_Y_LPARAM(LParam);
|
||||
Keys := WParam;
|
||||
end;
|
||||
end;
|
||||
WM_MOUSEHOVER:
|
||||
begin
|
||||
NotifyUserInput := True;
|
||||
|
@ -320,20 +320,13 @@ function LCLSendMouseMoveMsg(const Target: TControl; XPos, YPos: SmallInt;
|
||||
ShiftState: TShiftState = []): PtrInt;
|
||||
var
|
||||
Mess: TLMMouseMove;
|
||||
Keys: PtrInt;
|
||||
begin
|
||||
FillChar(Mess, SizeOf(Mess), 0);
|
||||
Mess.Msg := LM_MouseMove;
|
||||
Mess.XPos := XPos;
|
||||
Mess.YPos := YPos;
|
||||
|
||||
Keys := 0;
|
||||
if ssShift in ShiftState then Keys := Keys or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then Keys := Keys or MK_CONTROL;
|
||||
if ssLeft in ShiftState then Keys := Keys or MK_LBUTTON;
|
||||
if ssRight in ShiftState then Keys := Keys or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then Keys := Keys or MK_MBUTTON;
|
||||
Mess.Keys := Keys;
|
||||
Mess.Keys := ShiftStateToKeys(ShiftState);
|
||||
|
||||
Result := DeliverMessage(Target, Mess);
|
||||
end;
|
||||
@ -357,25 +350,20 @@ function LCLSendMouseDownMsg(const Target: TControl; XPos, YPos: SmallInt;
|
||||
Button: TMouseButton; ShiftState: TShiftState = []): PtrInt;
|
||||
var
|
||||
Mess: TLMMouse;
|
||||
Keys: PtrInt;
|
||||
begin
|
||||
FillChar(Mess, SizeOf(Mess), 0);
|
||||
case Button of
|
||||
mbLeft : Mess.Msg := LM_LBUTTONDOWN;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONDOWN;
|
||||
mbRight : Mess.Msg := LM_RBUTTONDOWN;
|
||||
mbExtra1 : Mess.Msg := LM_XBUTTONDOWN;
|
||||
mbExtra2 : Mess.Msg := LM_XBUTTONDOWN;
|
||||
end;
|
||||
|
||||
Mess.XPos := XPos;
|
||||
Mess.YPos := YPos;
|
||||
|
||||
Keys := 0;
|
||||
if ssShift in ShiftState then Keys := Keys or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then Keys := Keys or MK_CONTROL;
|
||||
if ssLeft in ShiftState then Keys := Keys or MK_LBUTTON;
|
||||
if ssRight in ShiftState then Keys := Keys or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then Keys := Keys or MK_MBUTTON;
|
||||
Mess.Keys := Keys;
|
||||
Mess.Keys := ShiftStateToKeys(ShiftState);
|
||||
|
||||
Result := DeliverMessage(Target, Mess);
|
||||
end;
|
||||
@ -398,25 +386,20 @@ function LCLSendMouseUpMsg(const Target: TControl; XPos, YPos: SmallInt;
|
||||
Button: TMouseButton; ShiftState: TShiftState): PtrInt;
|
||||
var
|
||||
Mess: TLMMouse;
|
||||
Keys: PtrInt;
|
||||
begin
|
||||
FillChar(Mess, SizeOf(Mess), 0);
|
||||
case Button of
|
||||
mbLeft : Mess.Msg := LM_LBUTTONUP;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONUP;
|
||||
mbRight : Mess.Msg := LM_RBUTTONUP;
|
||||
mbExtra1 : Mess.Msg := LM_XBUTTONUP;
|
||||
mbExtra2 : Mess.Msg := LM_XBUTTONUP;
|
||||
end;
|
||||
|
||||
Mess.XPos := XPos;
|
||||
Mess.YPos := YPos;
|
||||
|
||||
Keys := 0;
|
||||
if ssShift in ShiftState then Keys := Keys or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then Keys := Keys or MK_CONTROL;
|
||||
if ssLeft in ShiftState then Keys := Keys or MK_LBUTTON;
|
||||
if ssRight in ShiftState then Keys := Keys or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then Keys := Keys or MK_MBUTTON;
|
||||
Mess.Keys := Keys;
|
||||
Mess.Keys := ShiftStateToKeys(ShiftState);
|
||||
|
||||
Result := DeliverMessage(Target, Mess);
|
||||
end;
|
||||
@ -1080,41 +1063,40 @@ function LCLSendMouseMultiClickMsg(const Target: TControl; XPos, YPos: SmallInt;
|
||||
Button: TMouseButton; ClickCount: Byte = 2; ShiftState: TShiftState = []): PtrInt;
|
||||
var
|
||||
Mess: TLMMouse;
|
||||
Keys: PtrInt;
|
||||
begin
|
||||
FillChar(Mess, SizeOf(Mess), 0);
|
||||
Mess.Msg := LM_UNKNOWN;
|
||||
case ClickCount of
|
||||
2:
|
||||
case Button of
|
||||
mbLeft : Mess.Msg := LM_LBUTTONDBLCLK;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONDBLCLK;
|
||||
mbRight : Mess.Msg := LM_RBUTTONDBLCLK;
|
||||
mbLeft : Mess.Msg := LM_LBUTTONDBLCLK;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONDBLCLK;
|
||||
mbRight : Mess.Msg := LM_RBUTTONDBLCLK;
|
||||
mbExtra1 : Mess.Msg := LM_XBUTTONDBLCLK;
|
||||
mbExtra2 : Mess.Msg := LM_XBUTTONDBLCLK;
|
||||
end;
|
||||
3:
|
||||
case Button of
|
||||
mbLeft : Mess.Msg := LM_LBUTTONTRIPLECLK;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONTRIPLECLK;
|
||||
mbRight : Mess.Msg := LM_RBUTTONTRIPLECLK;
|
||||
mbLeft : Mess.Msg := LM_LBUTTONTRIPLECLK;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONTRIPLECLK;
|
||||
mbRight : Mess.Msg := LM_RBUTTONTRIPLECLK;
|
||||
mbExtra1 : Mess.Msg := LM_XBUTTONTRIPLECLK;
|
||||
mbExtra2 : Mess.Msg := LM_XBUTTONTRIPLECLK;
|
||||
end;
|
||||
4:
|
||||
case Button of
|
||||
mbLeft : Mess.Msg := LM_LBUTTONQUADCLK;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONQUADCLK;
|
||||
mbRight : Mess.Msg := LM_RBUTTONQUADCLK;
|
||||
mbLeft : Mess.Msg := LM_LBUTTONQUADCLK;
|
||||
mbMiddle : Mess.Msg := LM_MBUTTONQUADCLK;
|
||||
mbRight : Mess.Msg := LM_RBUTTONQUADCLK;
|
||||
mbExtra1 : Mess.Msg := LM_XBUTTONQUADCLK;
|
||||
mbExtra2 : Mess.Msg := LM_XBUTTONQUADCLK;
|
||||
end;
|
||||
end;
|
||||
|
||||
Mess.XPos := XPos;
|
||||
Mess.YPos := YPos;
|
||||
|
||||
Keys := 0;
|
||||
if ssShift in ShiftState then Keys := Keys or MK_SHIFT;
|
||||
if ssCtrl in ShiftState then Keys := Keys or MK_CONTROL;
|
||||
if ssLeft in ShiftState then Keys := Keys or MK_LBUTTON;
|
||||
if ssRight in ShiftState then Keys := Keys or MK_RBUTTON;
|
||||
if ssMiddle in ShiftState then Keys := Keys or MK_MBUTTON;
|
||||
Mess.Keys := Keys;
|
||||
Mess.Keys := ShiftStateToKeys(ShiftState);
|
||||
|
||||
Result := DeliverMessage(Target, Mess);
|
||||
end;
|
||||
|
@ -90,11 +90,13 @@ const
|
||||
LM_RBUTTONQUADCLK = LM_MOUSEFIRST2 + 5;
|
||||
LM_MOUSEENTER = LM_MOUSEFIRST2 + 6;
|
||||
LM_MOUSELEAVE = LM_MOUSEFIRST2 + 7;
|
||||
LM_MOUSELAST2 = LM_MOUSELEAVE;
|
||||
LM_XBUTTONTRIPLECLK = LM_MOUSEFIRST2 + 8;
|
||||
LM_XBUTTONQUADCLK = LM_MOUSEFIRST2 + 9;
|
||||
LM_MOUSELAST2 = LM_XBUTTONQUADCLK;
|
||||
// for triple and quad clicks see below
|
||||
|
||||
LM_GRABFOCUS = LM_LCL + 79;
|
||||
LM_DRAWLISTITEM = LM_LCL + 80;
|
||||
LM_GRABFOCUS = LM_LCL + 80;
|
||||
LM_DRAWLISTITEM = LM_LCL + 81;
|
||||
LM_CONTEXTMENU = LM_LCL + 82;
|
||||
|
||||
// these IDs are reserved for internal messages in the interfaces
|
||||
@ -214,7 +216,10 @@ const
|
||||
LM_MBUTTONUP = $0208;
|
||||
LM_MBUTTONDBLCLK = $0209;
|
||||
LM_MOUSEWHEEL = $020A;
|
||||
LM_MOUSELAST = $020A;
|
||||
LM_XBUTTONDOWN = $020B;
|
||||
LM_XBUTTONUP = $020C;
|
||||
LM_XBUTTONDBLCLK = $020D;
|
||||
LM_MOUSELAST = $020D;
|
||||
|
||||
LM_PARENTNOTIFY = $0210;
|
||||
LM_CAPTURECHANGED = $0215;
|
||||
@ -678,18 +683,23 @@ type
|
||||
TLMLButtonDown = TLMMouse;
|
||||
TLMRButtonDown = TLMMouse;
|
||||
TLMMButtonDown = TLMMouse;
|
||||
TLMXButtonDown = TLMMouse;
|
||||
TLMLButtonDblClk = TLMMouse;
|
||||
TLMRButtonDblClk = TLMMouse;
|
||||
TLMMButtonDblClk = TLMMouse;
|
||||
TLMXButtonDblClk = TLMMouse;
|
||||
TLMLButtonTripleClk = TLMMouse;
|
||||
TLMRButtonTripleClk = TLMMouse;
|
||||
TLMMButtonTripleClk = TLMMouse;
|
||||
TLMXButtonTripleClk = TLMMouse;
|
||||
TLMLButtonQuadClk = TLMMouse;
|
||||
TLMRButtonQuadClk = TLMMouse;
|
||||
TLMMButtonQuadClk = TLMMouse;
|
||||
TLMXButtonQuadClk = TLMMouse;
|
||||
TLMLButtonUp = TLMMouse;
|
||||
TLMRButtonUp = TLMMouse;
|
||||
TLMMButtonUp = TLMMouse;
|
||||
TLMXButtonUp = TLMMouse;
|
||||
|
||||
TLMSetFocus = record
|
||||
Msg: Cardinal;
|
||||
|
Loading…
Reference in New Issue
Block a user