Hi,
I have only recently noticed that Delphi 5 programs don't seem to require
the ALT key to be held down to trigger accelerator keys. For example put a
couple of TButton controls on a form with captions such as '&First' and
'&Second' and with some OnClick code (eg ShowMessage). Try running the
application and you will quickly find that pressing the f key will trigger
the First button and s will trigger the Second button (unless focus is on an
edit box which is capturing key input).
Have I missed something here? I thought that the point of accelerator keys
was that they would be triggered IF and ONLY IF the ALT key was
simultaneously held down. I believe this is how it always used to work in
Delphi 3...
Any comments would be appreciated. As it stands they are far to trigger
happy (the poor users will be setting off buttons and actions all over the
place) and the only practical solution seems to be to remove them.
BTW for those that are interested the code causing this behaviour would
appear to be in StdCtrls (and elsewhere) such as...
procedure TButton.CMDialogChar(var Message: TCMDialogChar);
begin
with Message do
if IsAccel(CharCode, Caption) and CanFocus then
begin
Click;
Result := 1;
end else
inherited;
end;
Thanks,
David.
DB Solutions.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"