Ejemplo n.º 1
0
        public void AddFocusedControlHandlers(InteractiveControl control)
        {
            if (control == null)
            {
                return;
            }

            CursorMoveLeft_EventHandler  += control.OnCursorMoveLeft;
            CursorMoveUp_EventHandler    += control.OnCursorMoveUp;
            CursorMoveRight_EventHandler += control.OnCursorMoveRight;
            CursorMoveDown_EventHandler  += control.OnCursorMoveDown;

            ForcedCursorMoveLeft_EventHandler  += control.OnForcedCursorMoveLeft;
            ForcedCursorMoveUp_EventHandler    += control.OnForcedCursorMoveUp;
            ForcedCursorMoveRight_EventHandler += control.OnForcedCursorMoveRight;
            ForcedCursorMoveDown_EventHandler  += control.OnForcedCursorMoveDown;

            PressedCursorMoveLeft_EventHandler  += control.OnPressedCursorMoveLeft;
            PressedCursorMoveUp_EventHandler    += control.OnPressedCursorMoveUp;
            PressedCursorMoveRight_EventHandler += control.OnPressedCursorMoveRight;
            PressedCursorMoveDown_EventHandler  += control.OnPressedCursorMoveDown;

            CursorClick_EventHandler += control.OnCursorClick;

            control?.OnCursorOver(relatedSurface, new CursorEventArgs(relatedSurface.ScreenCursor.CursorPosition, CursorEventType.CursorMove));

            UpdateKeysHandlers();
        }
Ejemplo n.º 2
0
        private void InitEvents()
        {
            CursorMoveLeft_EventHandler  += relatedSurface.ScreenCursor.MoveLeft;
            CursorMoveUp_EventHandler    += relatedSurface.ScreenCursor.MoveUp;
            CursorMoveRight_EventHandler += relatedSurface.ScreenCursor.MoveRight;
            CursorMoveDown_EventHandler  += relatedSurface.ScreenCursor.MoveDown;

            PressedCursorMoveLeft_EventHandler  += relatedSurface.ScreenCursor.PressedMoveLeft;
            PressedCursorMoveUp_EventHandler    += relatedSurface.ScreenCursor.PressedMoveup;
            PressedCursorMoveRight_EventHandler += relatedSurface.ScreenCursor.PressedMoveRight;
            PressedCursorMoveDown_EventHandler  += relatedSurface.ScreenCursor.PressedMoveDown;

            ForcedCursorMoveLeft_EventHandler  += relatedSurface.ScreenCursor.ForcedMoveLeft;
            ForcedCursorMoveUp_EventHandler    += relatedSurface.ScreenCursor.ForcedMoveUp;
            ForcedCursorMoveRight_EventHandler += relatedSurface.ScreenCursor.ForcedMoveRight;
            ForcedCursorMoveDown_EventHandler  += relatedSurface.ScreenCursor.ForcedMoveDown;

            CursorClick_EventHandler += relatedSurface.ScreenCursor.Click;
        }
Ejemplo n.º 3
0
        public void RemoveFocusedControlHandlers(InteractiveControl control)
        {
            CursorMoveLeft_EventHandler  -= control.OnCursorMoveLeft;
            CursorMoveUp_EventHandler    -= control.OnCursorMoveUp;
            CursorMoveRight_EventHandler -= control.OnCursorMoveRight;
            CursorMoveDown_EventHandler  -= control.OnCursorMoveDown;

            ForcedCursorMoveLeft_EventHandler  -= control.OnForcedCursorMoveLeft;
            ForcedCursorMoveUp_EventHandler    -= control.OnForcedCursorMoveUp;
            ForcedCursorMoveRight_EventHandler -= control.OnForcedCursorMoveRight;
            ForcedCursorMoveDown_EventHandler  -= control.OnForcedCursorMoveDown;

            PressedCursorMoveLeft_EventHandler  -= control.OnPressedCursorMoveLeft;
            PressedCursorMoveUp_EventHandler    -= control.OnPressedCursorMoveUp;
            PressedCursorMoveRight_EventHandler -= control.OnPressedCursorMoveRight;
            PressedCursorMoveDown_EventHandler  -= control.OnPressedCursorMoveDown;

            CursorClick_EventHandler -= control.OnCursorClick;

            control?.OnCursorOut(relatedSurface, new CursorEventArgs(relatedSurface.ScreenCursor.CursorPosition, CursorEventType.CursorMove));
            UpdateKeysHandlers();
        }