Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / TERMINAL ALIASES FROM WEFT
InputEvent
Events distinguish typed text, pasted text, keyboard phases/modifiers, mouse input, resizing, and termination signals. keyboardEvent normalizes legacy .key and extended .keyEvent, plus .text containing exactly one character; multi-character text is not normalized.
loom.InputEvent is an alias for weft.InputEvent. 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 event = InputEvent.text("ab")
switch event {
case let .text(text): for character in text { _ = character }
case let .resize(width, height): _ = (width, height)
default: _ = event.keyboardEvent
}Members on this page
Feature guides and release status
InputEvent
typealias InputEvent = weft.weft.InputEventEvents distinguish typed text, pasted text, keyboard phases/modifiers, mouse input, resizing, and termination signals. keyboardEvent normalizes legacy .key and extended .keyEvent, plus .text containing exactly one character; multi-character text is not normalized.
Source · TerminalExports.swift:19Underlying weft API
InputEvent
enum InputEventConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
Input from the terminal or a change to the terminal session.
Source · InputEvent.swift:2key(_:)
case key(Key)The key case. Associated values, if any, are shown in the declaration.
Source · InputEvent.swift:3keyEvent(_:)
case keyEvent(KeyEvent)The key event case. Associated values, if any, are shown in the declaration.
Source · InputEvent.swift:4text(_:)
case text(String)Typed text that can contain several characters in one read. Iterate its characters when interpreting key bindings.
Source · InputEvent.swift:5paste(_:)
case paste(String)Bracketed-paste text. Treat as inserted content rather than command keystrokes.
Source · InputEvent.swift:6pasteTruncated(_:)
case pasteTruncated(String)A bracketed paste exceeded the byte budget; only this prefix was retained.
Source · InputEvent.swift:8mouse(_:)
case mouse(MouseEvent)The mouse case. Associated values, if any, are shown in the declaration.
Source · InputEvent.swift:9focusChanged(_:)
case focusChanged(Bool)A terminal focus report: true on focus gain, false on focus loss.
Source · InputEvent.swift:11resize(_:_:)
case resize(Int, Int)New terminal width and height in cells. Resize the renderer and reflow cached layouts before drawing.
Source · InputEvent.swift:12signal(_:)
case signal(Int)POSIX signal number. Decide how to exit or react, and retain deferred session cleanup.
Source · InputEvent.swift:13queryResult(_:)
case queryResult(TerminalQueryResult)A requested query completed through the same reader as keyboard input.
Source · InputEvent.swift:15terminalReply(_:)
case terminalReply(TerminalReply)A recognized report; sessions opt into unsolicited color-scheme updates.
Source · InputEvent.swift:17terminalResumed
case terminalResumedTerminal ownership was reacquired; applications should redraw their interface.
Source · InputEvent.swift:19keyboardEvent
var keyboardEvent: KeyEvent? { get }A uniform keyboard view of legacy and extended input events.
Source · InputEvent.swift:24