void ClearEventQueue()
{
- while (PendingEvent())
- {
- Event event;
-
- WaitEvent(&event);
+ Event event;
+ while (NextValidEvent(&event))
+ {
switch (event.type)
{
case EVENT_BUTTONRELEASE:
{
Event event;
- WaitEvent(&event);
+ if (!WaitEventFiltered(&event))
+ continue;
switch (event.type)
{
while (!got_key_event)
{
- if (PendingEvent()) /* got event */
- {
- Event event;
-
- WaitEvent(&event);
+ Event event;
+ if (NextValidEvent(&event))
+ {
switch (event.type)
{
case EVENT_KEYPRESS:
while (!finished)
{
- if (PendingEvent()) /* got event */
- {
- Event event;
-
- WaitEvent(&event);
+ Event event;
+ if (NextValidEvent(&event))
+ {
switch (event.type)
{
case EVENT_KEYPRESS: