Avoid blocking `Active` state propagation

This commit is contained in:
Dean Herbert 2021-12-16 19:57:24 +09:00
parent 6bffeb6a24
commit abb617a3df
1 changed files with 5 additions and 2 deletions

View File

@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Input.StateChanges.Events;
@ -44,8 +45,10 @@ protected override bool HandleMouseTouchStateChange(TouchStateChangeEvent e)
{
if (!AllowUserCursorMovement)
{
// Still allow for forwarding of the "touch" part, but block the positional data.
e = new TouchStateChangeEvent(e.State, e.Input, e.Touch, false, null);
// Still allow for forwarding of the "touch" part, but replace the positional data with that of the mouse.
// Primarily relied upon by the "autopilot" osu! mod.
var touch = new Touch(e.Touch.Source, CurrentState.Mouse.Position);
e = new TouchStateChangeEvent(e.State, e.Input, touch, e.IsActive, null);
}
return base.HandleMouseTouchStateChange(e);