Table of Contents

Struct InputBinding

Namespace
Terminal.Gui.Input
Assembly
Terminal.Gui.dll

A generic input binding used for programmatic command invocations or when a specific binding type is not needed.

public struct InputBinding : IInputBinding, IEquatable<InputBinding>
Implements
Inherited Members

Remarks

Use InputBinding when invoking commands programmatically via InvokeCommand(Command) or when a binding is needed but is not associated with a specific key or mouse event.

Pattern match on binding types to discriminate between input sources:

if (ctx.Binding is KeyBinding kb) { /* key input */ }
    else if (ctx.Binding is MouseBinding mb) { /* mouse input */ }
    else if (ctx.Binding is InputBinding ib) { /* programmatic */ }

Constructors

InputBinding(Command[], View?, object?)

Initializes a new instance.

Properties

Commands

The commands this binding will invoke.

Data

Arbitrary context that can be associated with this input binding.

Source

Gets or sets the View that is the origin of this binding.

Methods

Equals(object)
Equals(InputBinding)
GetHashCode()
ToString()

Operators

operator ==(InputBinding, InputBinding)
operator !=(InputBinding, InputBinding)

See Also