Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / TERMINAL ALIASES FROM WEFT
KeyModifiers
An OptionSet of reported modifier and lock bits. Combine with array literals and test contains(.control), contains(.shift), and so on. Protocol support determines which modifiers are available.
loom.KeyModifiers is an alias for weft.KeyModifiers. 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 modifiers: KeyModifiers = [.shift, .control]
_ = modifiers.contains(.control)Members on this page
Feature guides and release status
KeyModifiers
typealias KeyModifiers = weft.weft.KeyModifiersAn OptionSet of reported modifier and lock bits. Combine with array literals and test contains(.control), contains(.shift), and so on. Protocol support determines which modifiers are available.
Source · TerminalExports.swift:16Underlying weft API
KeyModifiers
struct KeyModifiersConforms to: Swift.Equatable, Swift.ExpressibleByArrayLiteral, Swift.OptionSet, Swift.RawRepresentable, Swift.Sendable, Swift.SendableMetatype, Swift.SetAlgebra.
Modifier bits reported by supported terminal keyboard protocols.
Source · KeyEvent.swift:2rawValue
let rawValue: UInt8Underlying identifier, bit field, or enum representation; see the containing type.
Source · KeyEvent.swift:3init(rawValue:)
init(rawValue: UInt8)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (1)
rawValue- Argument type and any default are shown in the declaration; see the behavior notes above.
shift
static let shift: KeyModifiersShift modifier bit.
Source · KeyEvent.swift:9alt
static let alt: KeyModifiersAlt/Option modifier bit.
Source · KeyEvent.swift:10control
static let control: KeyModifiersControl modifier bit.
Source · KeyEvent.swift:11superKey
static let superKey: KeyModifiersSuper/Command modifier bit when reported.
Source · KeyEvent.swift:12hyper
static let hyper: KeyModifiersHyper modifier bit when reported.
Source · KeyEvent.swift:13meta
static let meta: KeyModifiersMeta modifier bit when reported.
Source · KeyEvent.swift:14capsLock
static let capsLock: KeyModifiersCaps Lock state bit.
Source · KeyEvent.swift:15numLock
static let numLock: KeyModifiersNum Lock state bit.
Source · KeyEvent.swift:16