Undo the key entered by the user

1

In a Edit normal Delphi I want to undo the key that the user typed. If it were in the KeyPress event, just assign # 0 to the key variable. But I am and need to use the KeyDown event. In this event I can not. I've tried assigning 0, aborting then ... but unsuccessfully. Anyway, is it possible? If so, how?

    
asked by anonymous 25.10.2017 / 20:53

1 answer

2

The correct thing is to control by KeyPress .

No KeyDown or KeyUp is for additional validations, but you can try:

  if Key = VK_DELETE then
  begin
    Abort;
  end;

In this way we abort the effect of the delete key.

view more at dokwiki

    
26.10.2017 / 11:58