Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ppy
GitHub Repository: ppy/osu
Path: blob/master/osu.Game/Graphics/InputBlockingContainer.cs
4349 views
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;

namespace osu.Game.Graphics
{
    /// <summary>
    /// A simple container which blocks input events from travelling through it.
    ///
    /// Note that this will block right clicks as well. Special care needs to be taken to not break context menus from displaying.
    /// </summary>
    public partial class InputBlockingContainer : Container
    {
        protected override bool OnHover(HoverEvent e) => true;

        protected override bool OnMouseDown(MouseDownEvent e) => true;

        protected override bool OnClick(ClickEvent e) => true;
    }
}