Published release 0.2.1. Unreleased PR #2 reference.
LOOM 0.2.1 / TERMINAL ALIASES FROM WEFT
MouseEvent
A mouse kind and absolute zero-based terminal-cell position. Enable session mouse capture to receive clicks/drags, and reportMotion for unpressed hover movement.
loom.MouseEvent is an alias for weft.MouseEvent. 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 mouse = MouseEvent(kind: .down, position: Point(x: 2, y: 3))
_ = mouse.positionMembers on this page
Feature guides and release status
MouseEvent
typealias MouseEvent = weft.weft.MouseEventA mouse kind and absolute zero-based terminal-cell position. Enable session mouse capture to receive clicks/drags, and reportMotion for unpressed hover movement.
Source · TerminalExports.swift:18Underlying weft API
MouseEvent
struct MouseEventConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
A mouse action and its zero-based terminal position.
Source · MouseEvent.swift:24kind
let kind: MouseKindThe event’s keyboard phase or mouse action.
Source · MouseEvent.swift:25position
let position: PointAbsolute terminal-cell mouse position.
Source · MouseEvent.swift:26button
let button: MouseButton?Nil for hover and scrolling.
Source · MouseEvent.swift:28modifiers
let modifiers: KeyModifiersShift, Alt, and Control, when reported by the terminal.
Source · MouseEvent.swift:30init(kind:position:button:modifiers:)
init(kind: MouseKind, position: Point, button: MouseButton? = nil, modifiers: KeyModifiers = [])Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (4)
kind- Argument type and any default are shown in the declaration; see the behavior notes above.
position- Argument type and any default are shown in the declaration; see the behavior notes above.
button- Argument type and any default are shown in the declaration; see the behavior notes above.
modifiers- Argument type and any default are shown in the declaration; see the behavior notes above.