Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / TERMINAL ALIASES FROM WEFT
Key
Logical key identities decoded from terminal input. Extended modifiers and key phases are carried separately by KeyEvent. .character carries text; .interrupt and .endOfInput are distinct from app-defined quit bindings.
loom.Key is an alias for weft.Key. It is available through import loom. The underlying type’s members are documented here.
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.
Example
let key: Key = .character("q")
switch key {
case .character("q"), .escape: break
default: break
}Members on this page
Feature guides and release status
Key
typealias Key = weft.weft.KeyLogical key identities decoded from terminal input. Extended modifiers and key phases are carried separately by KeyEvent. .character carries text; .interrupt and .endOfInput are distinct from app-defined quit bindings.
Source · TerminalExports.swift:13Underlying weft API
Key
enum KeyConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
A key identity understood by the input decoder.
Source · Key.swift:2unknown
case unknownText input without a known physical key, such as an input-method event.
Source · Key.swift:4enter
case enterThe enter case. Associated values, if any, are shown in the declaration.
Source · Key.swift:5tab
case tabThe tab case. Associated values, if any, are shown in the declaration.
Source · Key.swift:6character(_:)
case character(String)The character case. Associated values, if any, are shown in the declaration.
Source · Key.swift:7function(_:)
case function(Int)The function case. Associated values, if any, are shown in the declaration.
Source · Key.swift:8backspace
case backspaceThe backspace case. Associated values, if any, are shown in the declaration.
Source · Key.swift:9delete
case deleteThe delete case. Associated values, if any, are shown in the declaration.
Source · Key.swift:10insert
case insertThe insert case. Associated values, if any, are shown in the declaration.
Source · Key.swift:11escape
case escapeThe escape case. Associated values, if any, are shown in the declaration.
Source · Key.swift:12interrupt
case interruptThe interrupt case. Associated values, if any, are shown in the declaration.
Source · Key.swift:13endOfInput
case endOfInputThe end of input case. Associated values, if any, are shown in the declaration.
Source · Key.swift:14newline
case newlineThe newline case. Associated values, if any, are shown in the declaration.
Source · Key.swift:15up
case upThe up case. Associated values, if any, are shown in the declaration.
Source · Key.swift:16down
case downThe down case. Associated values, if any, are shown in the declaration.
Source · Key.swift:17left
case leftThe left case. Associated values, if any, are shown in the declaration.
Source · Key.swift:18right
case rightThe right case. Associated values, if any, are shown in the declaration.
Source · Key.swift:19home
case homeThe home case. Associated values, if any, are shown in the declaration.
Source · Key.swift:20end
case endThe end case. Associated values, if any, are shown in the declaration.
Source · Key.swift:21pageUp
case pageUpThe page up case. Associated values, if any, are shown in the declaration.
Source · Key.swift:22pageDown
case pageDownThe page down case. Associated values, if any, are shown in the declaration.
Source · Key.swift:23begin
case beginThe keypad center key when it does not produce a digit.
Source · Key.swift:25first
case firstThe first case. Associated values, if any, are shown in the declaration.
Source · Key.swift:26last
case lastThe last case. Associated values, if any, are shown in the declaration.
Source · Key.swift:27f2
case f2The f2 case. Associated values, if any, are shown in the declaration.
Source · Key.swift:28