Create a VCL Forms application and in the main form's OnMouseDown
event handler write:
procedure TForm2.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if Shift = [ssCtrl] then
ShowMessage('CTRL pressed');
end;
Then run the app, press and hold the CTRL key down, with no other modifier keys, and then click on the form. No message is displayed. Why now?
So which value does Shift
have in this case when only the CTRL key is pressed?