mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Use PlatformAction.Delete instead of Delete key
This commit is contained in:
@ -8,6 +8,8 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Input.States;
|
||||
using osu.Game.Graphics;
|
||||
@ -22,7 +24,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <summary>
|
||||
/// A component which outlines <see cref="DrawableHitObject"/>s and handles movement of selections.
|
||||
/// </summary>
|
||||
public class SelectionHandler : CompositeDrawable
|
||||
public class SelectionHandler : CompositeDrawable, IKeyBindingHandler<PlatformAction>
|
||||
{
|
||||
public const float BORDER_RADIUS = 2;
|
||||
|
||||
@ -72,22 +74,21 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
if (e.Repeat)
|
||||
return base.OnKeyDown(e);
|
||||
|
||||
switch (e.Key)
|
||||
switch (action.ActionMethod)
|
||||
{
|
||||
case Key.Delete:
|
||||
case PlatformActionMethod.Delete:
|
||||
foreach (var h in selectedBlueprints.ToList())
|
||||
placementHandler.Delete(h.DrawableObject.HitObject);
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnKeyDown(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnReleased(PlatformAction action) => action.ActionMethod == PlatformActionMethod.Delete;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Selection Handling
|
||||
|
Reference in New Issue
Block a user