Exemple #1
0
        public InputRecord NextEvent(InputRecordType Filter = InputRecordType.All)
        {
            while (true)
            {
                InputRecord[] EventList = ReadPendingEvents(1);
                if (EventList == null)
                {
                    continue;
                }

                if ((EventList[0].EventType & Filter) != 0)
                {
                    return(EventList[0]);
                }
            }
        }
Exemple #2
0
        public bool IsEventPending(InputRecordType EventType)
        {
            if (PendingEventCount == 0)
            {
                return(false);
            }

            InputRecord[] Events = PeekPendingEvents();

            foreach (InputRecord Event in Events)
            {
                if ((InputRecordType)Event.EventType == EventType)
                {
                    if (Event.KeyEvent.KeyDown != 0)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }