Start a new VCL Application, drop a TEdit
on the Form and assign this to OnKeyPress
event:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
Caption:=Caption+' '+IntToStr(Ord(Key));
end;
When you run the application and press, for example, Ctrl+M or Ctrl+H you will receive control characters #13 (Enter) and #8 (Backspace) in Key OnKeyPress
event. Is there a way to stop this annoying behavior ? I mean completely stop receiving OnKeyPress
when I press shortcuts like Ctrl+M, not testing for Ctrl down and do nothing inside the event. I want my application to process Enter key when Enter key is pressed not Ctrl+M. I hope you understand what I'm saying...