procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Shift >= [ssShift] then
label1.Caption := '你按下了Shift鍵';
if Shift >= [ssAlt] then
label1.Caption := '你按下了Alt鍵';
if Shift >= [ssCtrl] then
label1.Caption := '你按下了Ctrl鍵';
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Shift >= [ssLeft] then
label1.Caption := '你單擊鼠標左鍵';
if Shift >= [ssMiddle] then
label1.Caption := '你單擊鼠標中鍵';
if Shift >= [ssDouble] then
label1.Caption := '你雙擊了鼠標';
if ssRight in Shift then
label1.Caption := '你單擊鼠標右鍵';
end;