procedure TSCU.Memo1KeyPress(Sender: TObject; var Key: char);var DateString: string; TimeString: string; InReadPW: boolean = false; R: Longint;begin KeyPressed := UpCase(Key);
Would it be better to use keydown event instead for this?
*snip*and while it reads the first key pressed, subsequent key presses leave KeyPressed stuck at the first character that was typed (viewing in the Watch window while debugging). Once I grab that key (I am adding it to a buffer) how do I get the next key pressed to be captured by this function?
In a TMemo, during the KeyPressed event how do you get the key pressed to be "disposed of" (or dropped is maybe a better term) once you do what you want with it
Quote from: Joanna on March 28, 2024, 03:07:47 amWould it be better to use keydown event instead for this?rather KeyUpKeyDown fires permanently, when you hold a key down.KeyUp only fires once per "Key-Press"
Quote from: Zvoni on March 28, 2024, 09:13:47 amQuote from: Joanna on March 28, 2024, 03:07:47 amWould it be better to use keydown event instead for this?rather KeyUpKeyDown fires permanently, when you hold a key down.KeyUp only fires once per "Key-Press"Interesting, so the key up event isn’t too late to set the key to #0 ?