>>>
Hi all,

 I'm sure there must be a very simple solution to this. I used to do the equivalent back in Borland Pascal V2

I have an Edit Control with which I trap the 'OnKeyDown' event as well as building the normal 'text' string.
<<<

Hi Colin, here is a code snippet I just clipped out of a little
practice program I once wrote to test certain behaviour.
You may have to set keypreview to true for the form for this
to work ... what components it accesses should be fairly
obvious.

cheers, -Peter


procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var letter: char;
begin
label2.caption := inttostr(key);
if key = vk_left then
begin
label2.caption := 'cursor left';
key := 0;
end;
if key = vk_return then
begin
label2.caption := 'enter';
key := 0;
end;
if key = vk_menu then
begin
label2.caption := 'Alt';
key := 0;
end;
letter := char(key);
if ssctrl in shift then label1.caption := 'control ' + letter + ' ' + inttostr(key)
else if ssalt in shift then label1.caption := 'alt ' + letter + ' ' + inttostr(key)
else label1.caption := letter +' '+inttostr(key);
end;


--------------------------------------------------------------------------- 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"

Reply via email to