diff --git a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow.cs b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow.cs index 1e2283b58b..8fcf519a2e 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/KeyBindingRow.cs @@ -39,14 +39,11 @@ public partial class KeyBindingRow : Container, IFilterable /// public Action BindingUpdated { get; set; } - private readonly object action; - private readonly IEnumerable bindings; + public bool AllowMainMouseButtons; - private const float transition_time = 150; + public IEnumerable Defaults; - private const float height = 20; - - private const float padding = 5; + #region IFilterable private bool matchingFilter; @@ -60,23 +57,39 @@ public bool MatchingFilter } } - private Container content; - - public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => - content.ReceivePositionalInputAt(screenSpacePos); - public bool FilteringActive { get; set; } + public IEnumerable FilterTerms => bindings.Select(b => (LocalisableString)keyCombinationProvider.GetReadableString(b.KeyCombination)).Prepend(text.Text); + + #endregion + + private readonly object action; + private readonly IEnumerable bindings; + + private Bindable isDefault { get; } = new BindableBool(true); + [Resolved] private ReadableKeyCombinationProvider keyCombinationProvider { get; set; } + [Resolved] + private RealmAccess realm { get; set; } + + private Container content; + private OsuSpriteText text; private FillFlowContainer cancelAndClearButtons; private FillFlowContainer buttons; - private Bindable isDefault { get; } = new BindableBool(true); + private KeyButton bindTarget; - public IEnumerable FilterTerms => bindings.Select(b => (LocalisableString)keyCombinationProvider.GetReadableString(b.KeyCombination)).Prepend(text.Text); + private const float transition_time = 150; + private const float height = 20; + private const float padding = 5; + + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => + content.ReceivePositionalInputAt(screenSpacePos); + + public override bool AcceptsFocus => bindTarget == null; public KeyBindingRow(object action, List bindings) { @@ -87,9 +100,6 @@ public KeyBindingRow(object action, List bindings) AutoSizeAxes = Axes.Y; } - [Resolved] - private RealmAccess realm { get; set; } - [BackgroundDependencyLoader] private void load(OverlayColourProvider colourProvider) { @@ -205,14 +215,6 @@ protected override void OnHoverLost(HoverLostEvent e) base.OnHoverLost(e); } - public override bool AcceptsFocus => bindTarget == null; - - private KeyButton bindTarget; - - public bool AllowMainMouseButtons; - - public IEnumerable Defaults; - private bool isModifier(Key k) => k < Key.F1; protected override bool OnClick(ClickEvent e) => true;