Of course, as usual, many ways to skin a cat.

Code: Select all
//Do not remove the spaces as they are there for alignment
Dialog>Dialog1
object Dialog1: TForm
Left = 675
Top = 413
HelpContext = 5000
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Mouse Test by Phil P (www.pendlebury.biz)'
ClientHeight = 236
ClientWidth = 504
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object MSMemo1: tMSMemo
Left = 8
Top = 37
Width = 289
Height = 192
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Courier New'
Font.Style = []
ParentFont = False
ScrollBars = ssVertical
TabOrder = 0
end
object MSButton1: tMSButton
Left = 304
Top = 8
Width = 193
Height = 193
Caption = 'MOUSE HERE'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton2: tMSButton
Left = 6
Top = 8
Width = 291
Height = 25
Caption = 'CLEAR'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 2
DoBrowse = False
BrowseStyle = fbOpen
end
object Edit1: TEdit
Left = 304
Top = 208
Width = 193
Height = 21
TabOrder = 3
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton2,OnClick,CLEAR
AddDialogHandler>Dialog1,MSButton1,OnMouseDown,MDOWN
AddDialogHandler>Dialog1,MSButton1,OnMouseUp,MUP
AddDialogHandler>Dialog1,MSButton1,OnMouseMove,MOVE
AddDialogHandler>Dialog1,,OnClose,EXIT
Show>Dialog1,result
Let>lines=0
SRT>MDOWN
GetCursorPos>mx,my
GOSUB>DBUTCHECK
GOSUB>EXIST
IF>%existing%=
SetDialogProperty>Dialog1,MSMemo1,Text,%clicktime% %dbutt% Down (x=%mx% y=%my%)
ELSE
SetDialogProperty>Dialog1,MSMemo1,Text,%existing%%CRLF%%clicktime% %dbutt% Down (x=%mx% y=%my%)
ENDIF
END>MDOWN
SRT>MUP
GetCursorPos>mx,my
GOSUB>UBUTCHECK
GOSUB>EXIST
SetDialogProperty>Dialog1,MSMemo1,Text,%existing%%CRLF%%clicktime% %ubutt% Up (x=%mx% y=%my%)
END>MUP
SRT>MOVE
GetCursorPos>mx,my
SetDialogProperty>Dialog1,Edit1,Text,x=%mx% y=%my%
END>MOVE
SRT>CLEAR
SetDialogProperty>Dialog1,MSMemo1,Text,
END>CLEAR
SRT>EXIST
GetDialogProperty>Dialog1,MSMemo1,Text,existing
GetTime>clicktime
END>EXIST
SRT>DBUTCHECK
Let>mdbutton=%MDOWN_BUTTON%
SetDialogProperty>Dialog1,Edit1,Text,x=%mx% y=%my% button val: %mdbutton%
IF>mdbutton=0
LET>dbutt=Left
ENDIF
IF>mdbutton=8386
LET>dbutt=Right
ENDIF
IF>mdbutton=32
LET>dbutt=Middle
ENDIF
END>DBUTCHECK
SRT>UBUTCHECK
Let>mubutton=%MUP_BUTTON%
SetDialogProperty>Dialog1,Edit1,Text,x=%mx% y=%my% button val: %mubutton%
IF>mubutton=0
LET>ubutt=Left
ENDIF
IF>mubutton=8386
LET>ubutt=Right
ENDIF
IF>mubutton=32
LET>ubutt=Middle
ENDIF
END>UBUTCHECK
SRT>EXIT
Exit>0
END>EXIT