mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
#nullable disable
|
|
|
|
using osu.Framework.Bindables;
|
|
using osu.Framework.Input;
|
|
using osuTK.Input;
|
|
|
|
namespace osu.Game.Input
|
|
{
|
|
public partial class OsuUserInputManager : UserInputManager
|
|
{
|
|
protected override bool AllowRightClickFromLongTouch => !LocalUserPlaying.Value;
|
|
|
|
public readonly BindableBool LocalUserPlaying = new BindableBool();
|
|
|
|
internal OsuUserInputManager()
|
|
{
|
|
}
|
|
|
|
protected override MouseButtonEventManager CreateButtonEventManagerFor(MouseButton button)
|
|
{
|
|
switch (button)
|
|
{
|
|
case MouseButton.Right:
|
|
return new RightMouseManager(button);
|
|
}
|
|
|
|
return base.CreateButtonEventManagerFor(button);
|
|
}
|
|
|
|
private class RightMouseManager : MouseButtonEventManager
|
|
{
|
|
public RightMouseManager(MouseButton button)
|
|
: base(button)
|
|
{
|
|
}
|
|
|
|
public override bool EnableDrag => true; // allow right-mouse dragging for absolute scroll in scroll containers.
|
|
public override bool EnableClick => false;
|
|
public override bool ChangeFocusOnClick => false;
|
|
}
|
|
}
|
|
}
|