diff --git a/osu.Game.Rulesets.Catch/CatchInputManager.cs b/osu.Game.Rulesets.Catch/CatchInputManager.cs index 1898ea8d04..3e292ac08a 100644 --- a/osu.Game.Rulesets.Catch/CatchInputManager.cs +++ b/osu.Game.Rulesets.Catch/CatchInputManager.cs @@ -11,18 +11,18 @@ namespace osu.Game.Rulesets.Catch { public class CatchInputManager : DatabasedKeyBindingInputManager { - public CatchInputManager(RulesetInfo ruleset) : base(ruleset, concurrencyMode: ConcurrentActionMode.UniqueActions) + public CatchInputManager(RulesetInfo ruleset) : base(ruleset, simultaneousMode: SimultaneousBindingMode.Unique) { } - protected override IDictionary CreateDefaultMappings() => new Dictionary + protected override IEnumerable CreateDefaultMappings() => new[] { - { Key.Z, CatchAction.MoveLeft }, - { Key.Left, CatchAction.MoveLeft }, - { Key.X, CatchAction.MoveRight }, - { Key.Right, CatchAction.MoveRight }, - { Key.LShift, CatchAction.Dash }, - { Key.RShift, CatchAction.Dash }, + new KeyBinding( Key.Z, CatchAction.MoveLeft), + new KeyBinding( Key.Left, CatchAction.MoveLeft), + new KeyBinding( Key.X, CatchAction.MoveRight), + new KeyBinding( Key.Right, CatchAction.MoveRight), + new KeyBinding( Key.LShift, CatchAction.Dash), + new KeyBinding( Key.RShift, CatchAction.Dash), }; } diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 9cf6bbc36b..f416f6acfb 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Catch.UI catcher.Size = new Vector2(DrawSize.Y); } - private class Catcher : Container, IHandleKeyBindings + private class Catcher : Container, IKeyBindingHandler { private Texture texture; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs index ef1d8f9e0e..0c3c4f0a6d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs @@ -12,7 +12,7 @@ using OpenTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { - public class CirclePiece : Container, IHandleKeyBindings + public class CirclePiece : Container, IKeyBindingHandler { private readonly Sprite disc; diff --git a/osu.Game.Rulesets.Osu/OsuInputManager.cs b/osu.Game.Rulesets.Osu/OsuInputManager.cs index 9e2a268632..c1ee19d8c5 100644 --- a/osu.Game.Rulesets.Osu/OsuInputManager.cs +++ b/osu.Game.Rulesets.Osu/OsuInputManager.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Osu { public class OsuInputManager : DatabasedKeyBindingInputManager { - public OsuInputManager(RulesetInfo ruleset) : base(ruleset, concurrencyMode: ConcurrentActionMode.UniqueActions) + public OsuInputManager(RulesetInfo ruleset) : base(ruleset, simultaneousMode: SimultaneousBindingMode.Unique) { } @@ -34,12 +34,12 @@ namespace osu.Game.Rulesets.Osu } } - protected override IDictionary CreateDefaultMappings() => new Dictionary + protected override IEnumerable CreateDefaultMappings() => new[] { - { Key.Z, OsuAction.LeftButton }, - { Key.X, OsuAction.RightButton }, - { Key.LastKey + 1, OsuAction.LeftButton }, - { Key.LastKey + 2, OsuAction.RightButton }, + new KeyBinding(Key.Z, OsuAction.LeftButton), + new KeyBinding(Key.X, OsuAction.RightButton), + new KeyBinding(Key.LastKey + 1, OsuAction.LeftButton), + new KeyBinding(Key.LastKey + 2, OsuAction.RightButton), }; } diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index b3be6dd610..adfc946f86 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -16,7 +16,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Osu.UI.Cursor { - public class GameplayCursor : CursorContainer, IHandleKeyBindings + public class GameplayCursor : CursorContainer, IKeyBindingHandler { protected override Drawable CreateCursor() => new OsuCursor(); diff --git a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs index d31c4ab55d..ab744c8037 100644 --- a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs @@ -22,9 +22,9 @@ namespace osu.Game.Input.Bindings /// /// A reference to identify the current . Used to lookup mappings. Null for global mappings. /// An optional variant for the specified . Used when a ruleset has more than one possible keyboard layouts. - /// Specify how to deal with multiple matches of s and s. - protected DatabasedKeyBindingInputManager(RulesetInfo ruleset = null, int? variant = null, ConcurrentActionMode concurrencyMode = ConcurrentActionMode.None) - : base(concurrencyMode) + /// Specify how to deal with multiple matches of s and s. + protected DatabasedKeyBindingInputManager(RulesetInfo ruleset = null, int? variant = null, SimultaneousBindingMode simultaneousMode = SimultaneousBindingMode.None) + : base(simultaneousMode) { this.ruleset = ruleset; this.variant = variant; diff --git a/osu.Game/Input/Bindings/GlobalBindingInputManager.cs b/osu.Game/Input/Bindings/GlobalBindingInputManager.cs index 4255bfd657..60a4faa8cd 100644 --- a/osu.Game/Input/Bindings/GlobalBindingInputManager.cs +++ b/osu.Game/Input/Bindings/GlobalBindingInputManager.cs @@ -17,18 +17,18 @@ namespace osu.Game.Input.Bindings public GlobalBindingInputManager(OsuGameBase game) { - if (game is IHandleKeyBindings) + if (game is IKeyBindingHandler) handler = game; } - protected override IDictionary CreateDefaultMappings() => new Dictionary + protected override IEnumerable CreateDefaultMappings() => new[] { - { Key.F8, GlobalAction.ToggleChat }, - { Key.F9, GlobalAction.ToggleSocial }, - { new[] { Key.LControl, Key.LAlt, Key.R }, GlobalAction.ResetInputSettings }, - { new[] { Key.LControl, Key.T }, GlobalAction.ToggleToolbar }, - { new[] { Key.LControl, Key.O }, GlobalAction.ToggleSettings }, - { new[] { Key.LControl, Key.D }, GlobalAction.ToggleDirect }, + new KeyBinding(Key.F8, GlobalAction.ToggleChat), + new KeyBinding(Key.F9, GlobalAction.ToggleSocial), + new KeyBinding(new[] { Key.LControl, Key.LAlt, Key.R }, GlobalAction.ResetInputSettings), + new KeyBinding(new[] { Key.LControl, Key.T }, GlobalAction.ToggleToolbar), + new KeyBinding(new[] { Key.LControl, Key.O }, GlobalAction.ToggleSettings), + new KeyBinding(new[] { Key.LControl, Key.D }, GlobalAction.ToggleDirect), }; protected override bool PropagateKeyDown(IEnumerable drawables, InputState state, KeyDownEventArgs args) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 7e5c3987b5..f54fba4a0b 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -30,7 +30,7 @@ using osu.Game.Input.Bindings; namespace osu.Game { - public class OsuGame : OsuGameBase, IHandleKeyBindings + public class OsuGame : OsuGameBase, IKeyBindingHandler { public Toolbar Toolbar;