Mouse Down event


   hi there,
     
      procedure TForm1.xxxMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
   
     Could you please tell me the difference between TMouseButton and TshifState.

                                 Thanks in advance
inampudi1Asked:
Who is Participating?
 
Geert GConnect With a Mentor Oracle dbaCommented:
delphi.about.com has a lot on stuff like this.

http://delphi.about.com/od/vclusing/a/mouseevents.htm

0
 
xr1140Commented:
TMouseButton - indicates which button is pressed (left, middle, right)

TShiftState - this set contains the special keys which were pressed (if any) when the mouse button was clicked (Alt, Control, Shift etc).
0
 
inampudi1Author Commented:
Thank you expert,

  Then Shift in ssRight and Button = mbRight are same.

               Thank you

   
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
rfwoolfCommented:
No

In Microsoft Internet Explorer, if you press Ctrl and left-click on a link, it will open that link in a new window.
ssRight (Right Shift Button) is not the same as mbRight (Right mouse button)
0
 
SteveBayCommented:
Here is a simple test procedure to demonstrate what is happening in the OnMouseDown Event

Uses TypInfo
 
//
//
procedure TfrmMain.Label1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
     Label1.Caption := GetEnumName(TypeInfo(TMouseButton),  integer(Button)) + ' : ';
     if (ssShift in Shift) then Label1.Caption := Label1.Caption + 'ssShift ';
     if (ssAlt in Shift) then Label1.Caption := Label1.Caption + 'ssAlt ';
     if (ssCtrl in Shift) then Label1.Caption := Label1.Caption + 'ssCtrl ';
     if (ssLeft in Shift) then Label1.Caption := Label1.Caption + 'ssLeft ';
     if (ssRight in Shift) then Label1.Caption := Label1.Caption + 'ssRight ';
     if (ssMiddle in Shift) then Label1.Caption := Label1.Caption + 'ssMiddle ';
     if (ssDouble in Shift) then Label1.Caption := Label1.Caption + 'ssDouble ';
end;

Open in new window

0
 
Geert GOracle dbaCommented:
ssLeft means on the left side of the keyboard
ssRight ...
0
 
inampudi1Author Commented:
Thank you steve and geert.

          Could you suggest me any tutorials on this topic.

                              Thank you
0
 
Geert GOracle dbaCommented:
a B grade goes with a comment.
giving no comment implies you give an A grade

read the suggestions on grading ...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.