Skip to content

Commit c18cff2

Browse files
committed
make keybindings share base
1 parent 9002acf commit c18cff2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Terminal.Gui/Input/Keyboard/KeyBindings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace Terminal.Gui;
77
/// <seealso cref="Application.KeyBindings"/>
88
/// <seealso cref="View.KeyBindings"/>
99
/// <seealso cref="Command"/>
10-
public class KeyBindings
10+
public class KeyBindings : Bindings<Key,KeyBinding>
1111
{
1212
/// <summary>Initializes a new instance bound to <paramref name="target"/>.</summary>
13-
public KeyBindings (View? target) { Target = target; }
13+
public KeyBindings (View? target) :base((commands,key)=> new KeyBinding (commands)) { Target = target; }
1414

1515
/// <summary>Adds a <see cref="KeyBinding"/> to the collection.</summary>
1616
/// <param name="key"></param>

Terminal.Gui/Input/Mouse/MouseBindings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Terminal.Gui;
55

6-
public abstract class Bindings<TKey, TBind> where TKey: Enum where TBind : IInputBinding, new()
6+
public abstract class Bindings<TKey, TBind> where TBind : IInputBinding, new()
77
{
88
protected readonly Dictionary<TKey, TBind> _bindings = new ();
99
private readonly Func<Command [], TKey, TBind> _constructBinding;

0 commit comments

Comments
 (0)