dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Pascal
Expertise: Beginner
Feb 19, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Determining Shift Button State

Question:
How can I determine if is down or up while dragging an object within my app? The goal is to detect if something is being copied or moved.

Answer:
In the MouseDown event handler of a control, you'll see that the event handler is declared as follows:

procedure TForm1.SpeedButton2MouseDown(Sender: TObject; Button: TMouseButton;
 Shift: TShiftState; X, Y: Integer);
begin

end;
The Shift argument will tell you what shift button is pressed (Shift, Ctrl, or Alt). You can use it to detect the Shift state. For more details, look in the online help.
DevX Pro
 
Thanks for your registration, follow us on our social networks to keep up-to-date