#nullable enable
// These classes use a key binding system based on the design implemented in Scintilla.Net which is an
// MIT licensed open source project https://github.com/jacobslusser/ScintillaNET/blob/master/src/ScintillaNET/Command.cs
namespace Terminal.Gui;
///
/// Provides a collection of objects stored in .
///
///
///
///
public record struct KeyBinding
{
/// Initializes a new instance.
/// The commands this key binding will invoke.
/// Arbitrary context that can be associated with this key binding.
public KeyBinding (Command [] commands, object? context = null)
{
Commands = commands;
Data = context;
}
/// Initializes a new instance.
/// The commands this key binding will invoke.
/// The view the key binding is bound to.
/// Arbitrary data that can be associated with this key binding.
public KeyBinding (Command [] commands, View? target, object? data = null)
{
Commands = commands;
Target = target;
Data = data;
}
/// The commands this key binding will invoke.
public Command [] Commands { get; set; }
///
/// The Key that is bound to the .
///
public Key? Key { get; set; }
/// The view the key binding is bound to.
public View? Target { get; set; }
///
/// Arbitrary context that can be associated with this key binding.
///
public object? Data { get; set; }
}