mirror of https://github.com/ppy/osu
Add the ability to ignore the user's mouse movement.
This commit is contained in:
parent
ad93eda399
commit
023a5c6e4f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue