Emptying the Key Buffer

General help with the Ecere Cross Platform GUI toolkit: Window, common controls, events, etc.
Help with the 2D Graphics library: Surface, Display, Bitmap, Font and others.
Post Reply
mothdragon
Posts: 28
Joined: Mon Jan 18, 2010 11:56 pm

Emptying the Key Buffer

Post by mothdragon »

How do I go about emptying the Key Buffer so that the same key press isn't reacted to by two different things?
--==[[ Mothdragon ]]==--
- - - - - - - - - - - - - - - - -
Everything New is Old, Everything Old is New. Nothing exists, and it's all here.
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: Emptying the Key Buffer

Post by jerome »

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
Post Reply