Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / COLLECTIONS AND INTERACTION
KeyChord
A logical key and its exact modifiers, ignoring Caps Lock and Num Lock.
Legacy Ctrl-C/Ctrl-D events match their extended-keyboard equivalents. Release events
and pasted text never activate a chord. label can override the generated help label.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Members on this page
Feature guides and release status
KeyChord
struct KeyChordConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
A logical key and its exact modifiers, ignoring Caps Lock and Num Lock.
Legacy Ctrl-C/Ctrl-D events match their extended-keyboard equivalents. Release events
and pasted text never activate a chord. label can override the generated help label.
key
var key: KeyThe logical key identity.
Source · KeyMap.swift:6modifiers
var modifiers: KeyModifiersModifier and lock bits supplied by the terminal.
Source · KeyMap.swift:7label
var label: String?Visible item label.
Source · KeyMap.swift:8init(_:modifiers:label:)
init(_ key: Key, modifiers: KeyModifiers = [], label: String? = nil)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (3)
key- Logical key to handle.
modifiers- Argument type and any default are shown in the declaration; see the behavior notes above.
label- Argument type and any default are shown in the declaration; see the behavior notes above.
matches(_:)
func matches(_ event: InputEvent) -> BoolMatches key and exact modifiers after ignoring lock bits and normalizing legacy Ctrl-C/Ctrl-D. Releases and pasted text never match.
Parameters (1)
event- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns Bool.
displayLabel
var displayLabel: String { get }A public field of this type. Its value type and mutability are shown in the declaration.
Source · KeyMap.swift:23