[WD19] How to clear the keyboard?

Startbeitrag von Ola am 22.09.2015 05:55

How can I clear (empty) the keyboard buffer?

SendKey("") //Does not seem to work

I have a master file form window with a child table and a button to call a child record form window.

Both windows have Control-Enter specified as the accept key combination to launch their own OK (accept) button.

In some cases (but not all!!!) the Control-Enter pressed in the child form window goes also down to the master form window and closes it, too! How can I prevent this?

Best regards



Found a solution.
I added
to the end of the child form calling button,
and that keeps the master form window from closing.

But I would still like to know, how to clear the keyboard buffer...

Best regards

von Ola - am 22.09.2015 06:54
I don't know if it works but check the remark of the KeyPressed function in Asynchronous status report section.


von Paulo Oliveira - am 23.09.2015 17:45
Hi Paulo,

Thanks for the hint.
I tested it like this:

IF KeyPressed(kpControl) AND KeyPressed(VK_RETURN) THEN
Trace("First check: Form modified by pressing Control + Enter")

KeyPressed(kpControl, False)
KeyPressed(VK_RETURN, False)

IF KeyPressed(kpControl) AND KeyPressed(VK_RETURN) THEN
Trace("Checking for the second time: Form modified by pressing Control + Enter")

Both checks return true, so it doesn't work.

Best regards

von Ola - am 27.09.2015 09:45
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.