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.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using osu.Framework.Input;
using osu.Framework.Input.Bindings; using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Input.StateChanges.Events; using osu.Framework.Input.StateChanges.Events;
@ -44,8 +45,10 @@ protected override bool HandleMouseTouchStateChange(TouchStateChangeEvent e)
{ {
if (!AllowUserCursorMovement) if (!AllowUserCursorMovement)
{ {
// Still allow for forwarding of the "touch" part, but block the positional data. // Still allow for forwarding of the "touch" part, but replace the positional data with that of the mouse.
e = new TouchStateChangeEvent(e.State, e.Input, e.Touch, false, null); // 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); return base.HandleMouseTouchStateChange(e);