Ecere SDK/eC Forums • View topic - Emptying the Key Buffer




Ecere SDK/eC Forums

Ecere Developers Community

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.

Emptying the Key Buffer

Postby mothdragon » Tue Jul 31, 2012 9:08 am

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.
mothdragon
 
Posts: 28
Joined: Mon Jan 18, 2010 11:56 pm

Re: Emptying the Key Buffer

Postby jerome » Tue Jul 31, 2012 9:47 am

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
jerome
Site Admin
 
Posts: 621
Joined: Sat Jan 16, 2010 11:16 pm


Return to GUI Toolkit & 2D Graphics

Who is online

Users browsing this forum: No registered users and 4 guests

cron