KeyDown bug (or my ignorance?)
From: Alan Mead (amead_at_comcast.net)
Date: 11/19/04
- Next message: R: "Delphi, .NET and Mono?"
- Previous message: AlanGLLoyd: "Re: Spaces"
- Next in thread: Michael Brown: "Re: KeyDown bug (or my ignorance?)"
- Reply: Michael Brown: "Re: KeyDown bug (or my ignorance?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 19 Nov 2004 15:38:09 -0600
Sorry, I posted about this earlier using a dumb subject. My code:
procedure TForm1.SearchMemoKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
{ ShowMessage('You pressed '+IntToStr(Key)+
', a='+IntToStr(Ord('a'))+
'and A='+IntToStr(Ord('A')));
}
if (((Key=Ord('a')) or (Key=Ord('A'))) and
(ssCtrl IN Shift)) then
begin
SearchMemo.SelectAll;
end;
end;
The "if.. Selectall" block does not fire if I press Ctrl-a. It will fire
if I press Ctrl-Shift-a.
When I uncomment the ShowMessage, it shows: "You pressed 65, a=97 and
A=65" *regardless* of whether I press 'a' or 'A'.
So, input seems to be upper cased... is there a workaround or am I doing
something wrong?
I'm trying, BTW, to make the Memo select all it's text when the user
presses Ctrl-a (which seems to be a standard Windows shortcut).
-Alan
- Next message: R: "Delphi, .NET and Mono?"
- Previous message: AlanGLLoyd: "Re: Spaces"
- Next in thread: Michael Brown: "Re: KeyDown bug (or my ignorance?)"
- Reply: Michael Brown: "Re: KeyDown bug (or my ignorance?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|