Exemplo n.º 1
0
        protected override Event GetEvent()
        {
            Event Event = new Event();

            try
            {
                if (Pending.What != Event.Nothing)
                {
                    Event        = Pending;
                    Pending.What = Event.Nothing;
                }
                else
                {
                    Event = MouseManager.GetMouseEvent();
                    if (Event.What == Event.Nothing)
                    {
                        Event = Drivers.GetKeyEvent();
                        if (Event.What == Event.Nothing)
                        {
                            Event = Drivers.GetConsoleEvent();
                        }
                        if (Event.What == Event.Nothing)
                        {
                            Event = EventListeners.GetEvent();
                        }
                        if (Event.What == Event.Nothing)
                        {
                            Idle();
                        }
                    }
                }
                if (StatusLine != null)
                {
                    if ((Event.What & Event.KeyDown) != 0)
                    {
                        StatusLine.HandleEvent(ref Event);
                    }
                    else if ((Event.What & Event.MouseDown) != 0)
                    {
                        if (FirstThatContainsMouse(
                                new FirstThatContainsMouseProc(ContainsMouse), Event.Where) == StatusLine)
                        {
                            StatusLine.HandleEvent(ref Event);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                ErrorBox.Show("Exception : " + Ex.GetType().ToString(), Ex.Message, Ex.StackTrace);
            }
            return(Event);
        }