loom & weft
Made for Swift.

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.position
Members on this page

Feature guides and release status

MouseEvent

Type Alias
typealias MouseEvent = weft.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.

Source · TerminalExports.swift:18

Underlying weft API

MouseEvent

Structure
struct MouseEvent

Conforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.

A mouse action and its zero-based terminal position.

Source · MouseEvent.swift:24

kind

Instance Property
let kind: MouseKind

The event’s keyboard phase or mouse action.

Source · MouseEvent.swift:25

position

Instance Property
let position: Point

Absolute terminal-cell mouse position.

Source · MouseEvent.swift:26

button

Instance Property
let button: MouseButton?

Nil for hover and scrolling.

Source · MouseEvent.swift:28

modifiers

Instance Property
let modifiers: KeyModifiers

Shift, Alt, and Control, when reported by the terminal.

Source · MouseEvent.swift:30

init(kind:position:button:modifiers:)

Initializer
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.
Source · MouseEvent.swift:32