2021-05-28 01:45:04 +08:00
|
|
|
|
// 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.
|
|
|
|
|
|
2023-05-13 20:12:21 +08:00
|
|
|
|
using osu.Framework.Bindables;
|
2021-05-28 01:45:04 +08:00
|
|
|
|
using osu.Framework.Input;
|
2024-10-01 16:00:32 +08:00
|
|
|
|
using osu.Game.Screens.Play;
|
2021-05-28 01:45:04 +08:00
|
|
|
|
using osuTK.Input;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Input
|
|
|
|
|
{
|
|
|
|
|
public partial class OsuUserInputManager : UserInputManager
|
|
|
|
|
{
|
2024-10-07 18:01:25 +08:00
|
|
|
|
protected override bool AllowRightClickFromLongTouch => PlayingState.Value != LocalUserPlayingState.Playing;
|
2023-05-13 20:12:21 +08:00
|
|
|
|
|
2024-10-07 16:50:23 +08:00
|
|
|
|
public readonly IBindable<LocalUserPlayingState> PlayingState = new Bindable<LocalUserPlayingState>();
|
2023-05-13 20:12:21 +08:00
|
|
|
|
|
2021-05-28 01:45:04 +08:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|