mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
make keybindings share base
This commit is contained in:
@@ -7,10 +7,10 @@ namespace Terminal.Gui;
|
||||
/// <seealso cref="Application.KeyBindings"/>
|
||||
/// <seealso cref="View.KeyBindings"/>
|
||||
/// <seealso cref="Command"/>
|
||||
public class KeyBindings
|
||||
public class KeyBindings : Bindings<Key,KeyBinding>
|
||||
{
|
||||
/// <summary>Initializes a new instance bound to <paramref name="target"/>.</summary>
|
||||
public KeyBindings (View? target) { Target = target; }
|
||||
public KeyBindings (View? target) :base((commands,key)=> new KeyBinding (commands)) { Target = target; }
|
||||
|
||||
/// <summary>Adds a <see cref="KeyBinding"/> to the collection.</summary>
|
||||
/// <param name="key"></param>
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Terminal.Gui;
|
||||
|
||||
public abstract class Bindings<TKey, TBind> where TKey: Enum where TBind : IInputBinding, new()
|
||||
public abstract class Bindings<TKey, TBind> where TBind : IInputBinding, new()
|
||||
{
|
||||
protected readonly Dictionary<TKey, TBind> _bindings = new ();
|
||||
private readonly Func<Command [], TKey, TBind> _constructBinding;
|
||||
|
||||
Reference in New Issue
Block a user