Add the ability to ignore the user's mouse movement.

This commit is contained in:
Tav TaOr 2019-05-10 19:12:32 +03:00
parent ad93eda399
commit 023a5c6e4f
1 changed files with 12 additions and 0 deletions

View File

@ -18,6 +18,8 @@ public bool AllowUserPresses
set => ((OsuKeyBindingContainer)KeyBindingContainer).AllowUserPresses = value;
}
public bool AllowUserCursorMovement { get; set; } = true;
protected override RulesetKeyBindingContainer CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique)
=> new OsuKeyBindingContainer(ruleset, variant, unique);
@ -26,6 +28,16 @@ public OsuInputManager(RulesetInfo ruleset)
{
}
protected override bool Handle(UIEvent e)
{
if (!AllowUserCursorMovement && e is MouseMoveEvent)
{
return false;
}
return base.Handle(e);
}
private class OsuKeyBindingContainer : RulesetKeyBindingContainer
{
public bool AllowUserPresses = true;