struct

TUI::KeyMenu::Binding

Inherits Struct < Value < Object

One registered binding: trigger is the key/char #dispatch matches against, label is the exact text #hint shows for it, when an optional guard that must return true for the binding to be active (nil means always active), action the callback #dispatch invokes on a match.

Constructors

new(trigger : Key | Char, label : -> String, when : -> Bool | Nil, action : KeyEvent -> Nil)
Source

Instance methods

action
clone
Source
copy_with(trigger _trigger = @trigger, label _label = @label, when _when = @when, action _action = @action)
Source
label
trigger
when