Emptying the Key Buffer
-
- Posts: 28
- Joined: Mon Jan 18, 2010 11:56 pm
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?
--==[[ Mothdragon ]]==--
- - - - - - - - - - - - - - - - -
Everything New is Old, Everything Old is New. Nothing exists, and it's all here.
- - - - - - - - - - - - - - - - -
Everything New is Old, Everything Old is New. Nothing exists, and it's all here.
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
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