class

Bubbles::Key::Binding

Inherits Reference < Object

Binding describes a set of keybindings and, optionally, their associated help text.

Constructors

new(keys : Nil | Array(String) = nil, help : Bubbles::Key::Help = Help.new, disabled : Bool = false)
Source

Instance methods

disabled=(disabled : Bool)
Source
disabled?
Source
enabled

Enabled returns whether or not the keybinding is enabled. Kept for Go parity with key.Binding.Enabled.

Source
enabled=(v : Bool)
Source
enabled?

Enabled returns whether or not the keybinding is enabled. Disabled keybindings won't be activated and won't show up in help. Keybindings are enabled by default.

Source
help

Help returns the Help information for the keybinding.

Source
help=(help : Help)
Source
keys

Keys returns the keys for the keybinding.

Source
keys=(keys : Array(String) | Nil)
Source
keys=(keys : Array(String))
Source
set_enabled(v : Bool)

SetEnabled enables or disables the keybinding.

Source
set_help(key : String, desc : String)

SetHelp sets the help text for the keybinding.

Source
set_keys

SetKeys sets the keys for the keybinding. No-arg case: creates an empty (non-nil) key list to keep binding enabled (Go parity).

Source
set_keys(*keys : String)
Source
unbind

Unbind removes the keys and help from this binding, effectively nullifying it. This is a step beyond disabling it, since applications can enable or disable key bindings based on application state.

Source