Skip to content

Commit

Permalink
Fix pen events being handled twice
Browse files Browse the repository at this point in the history
Wouldn't fail the test as it would be a nop state change therefore not propagated as events
  • Loading branch information
Susko3 committed Jan 13, 2025
1 parent 2792b5a commit 3fc7237
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osu.Framework/Input/PassThroughInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ protected override bool Handle(UIEvent e)
case MouseDownEvent penDown:
Debug.Assert(penDown.Button == MouseButton.Left);
new MouseButtonInputFromPen(true) { DeviceType = penInput.DeviceType }.Apply(CurrentState, this);
break;
return false;

case MouseUpEvent penUp:
Debug.Assert(penUp.Button == MouseButton.Left);
new MouseButtonInputFromPen(false) { DeviceType = penInput.DeviceType }.Apply(CurrentState, this);
break;
return false;

case MouseMoveEvent penMove:
if (penMove.ScreenSpaceMousePosition != CurrentState.Mouse.Position)
new MousePositionAbsoluteInputFromPen { Position = penMove.ScreenSpaceMousePosition, DeviceType = penInput.DeviceType }.Apply(CurrentState, this);
break;
return false;
}
}

Expand Down

0 comments on commit 3fc7237

Please sign in to comment.