UnityEditor.PopupWindowWithoutFocus.OnGlobalMouseOrKeyEvent C# (CSharp) Method

OnGlobalMouseOrKeyEvent() private static method

private static OnGlobalMouseOrKeyEvent ( EventType type, KeyCode keyCode, Vector2 mousePosition ) : bool
type EventType
keyCode KeyCode
mousePosition Vector2
return bool
        private static bool OnGlobalMouseOrKeyEvent(EventType type, KeyCode keyCode, Vector2 mousePosition)
        {
            if (s_PopupWindowWithoutFocus != null)
            {
                if ((type == EventType.KeyDown) && (keyCode == KeyCode.Escape))
                {
                    s_PopupWindowWithoutFocus.Close();
                    return true;
                }
                if ((type == EventType.MouseDown) && !s_PopupWindowWithoutFocus.position.Contains(mousePosition))
                {
                    s_PopupWindowWithoutFocus.Close();
                    return true;
                }
            }
            return false;
        }