Add global flip hotkeys

This commit is contained in:
Dean Herbert
2022-01-05 16:46:34 +09:00
parent 13cce50fa7
commit 866ae3472b
8 changed files with 68 additions and 24 deletions

View File

@ -7,7 +7,6 @@ using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Input.Bindings;
using osu.Game.Rulesets.Edit;
@ -17,7 +16,7 @@ using osuTK.Input;
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
internal class TimelineSelectionHandler : EditorSelectionHandler, IKeyBindingHandler<GlobalAction>
internal class TimelineSelectionHandler : EditorSelectionHandler
{
[Resolved]
private Timeline timeline { get; set; }
@ -27,8 +26,11 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
// for now we always allow movement. snapping is provided by the Timeline's "distance" snap implementation
public override bool HandleMovement(MoveSelectionEvent<HitObject> moveEvent) => true;
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
// Importantly, we block the base call here.
// Other key operations will be handled by the composer view's SelectionHandler instead.
switch (e.Action)
{
case GlobalAction.EditorNudgeLeft:
@ -43,10 +45,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
return false;
}
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
{
}
/// <summary>
/// Nudge the current selection by the specified multiple of beat divisor lengths,
/// based on the timing at the first object in the selection.