mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
only propagate unmodified right click
This commit is contained in:
parent
4efa1f23bb
commit
c633e2e952
@ -57,8 +57,8 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
moveMouseToObject(() => addedObject);
|
moveMouseToObject(() => addedObject);
|
||||||
AddStep("right click", () => InputManager.Click(MouseButton.Right));
|
AddStep("right click", () => InputManager.Click(MouseButton.Right));
|
||||||
|
|
||||||
AddAssert("hitobject selected", () => EditorBeatmap.SelectedHitObjects.Single() == addedObject);
|
AddUntilStep("hitobject selected", () => EditorBeatmap.SelectedHitObjects.Single() == addedObject);
|
||||||
AddAssert("context menu is visible", () => contextMenuContainer.ChildrenOfType<OsuContextMenu>().Single().State == MenuState.Open);
|
AddUntilStep("context menu is visible", () => contextMenuContainer.ChildrenOfType<OsuContextMenu>().Single().State == MenuState.Open);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -113,8 +113,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
// check if selection has occurred
|
// check if selection has occurred
|
||||||
if (selectionPerformed)
|
if (selectionPerformed)
|
||||||
{
|
{
|
||||||
// propagate right click to show context menu on selection
|
// only unmodified right click should show context menu
|
||||||
return e.Button != MouseButton.Right;
|
var shouldShowContextMenu = e.Button == MouseButton.Right && !e.ShiftPressed && !e.AltPressed && !e.SuperPressed;
|
||||||
|
|
||||||
|
// stop propagation if not showing context menu
|
||||||
|
return !shouldShowContextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
// even if a selection didn't occur, a drag event may still move the selection.
|
// even if a selection didn't occur, a drag event may still move the selection.
|
||||||
|
Loading…
Reference in New Issue
Block a user