Ecere SDK/eC Forums
https://ecere.org/community/
Print view

Emptying the Key Buffer
https://ecere.org/community/viewtopic.php?f=5&t=243
Page 1 of 1
Author:  mothdragon [ Tue Jul 31, 2012 9:08 am ]
Post subject:  Emptying the Key Buffer

How do I go about emptying the Key Buffer so that the same key press isn't reacted to by two different things?
Author:  jerome [ Tue Jul 31, 2012 9:47 am ]
Post subject:  Re: Emptying the Key Buffer

Hi Charlie,

It is not really a buffer, but returning a value of 'false' from either OnKeyHit or OnKeyDown will prevent further windows or events to be invoked. This should be done inside the appropriate case statement of the switch(key) so as not to block 'all' keys.
Note that OnKeyDown is invoked first, so that returning false from OnKeyDown will result in OnKeyHit for that same window to not be called.

Regards,

Jerome
All times are UTC-05:00 Page 1 of 1