public import CoreGraphics public struct DragWindow: Equatable, Sendable { public let pid: Int32 public let windowNumber: UInt32 public let layer: Int32 public let bounds: CGRect? public var isDesktop: Bool { layer == CGWindowLevelForKey(.desktopWindow) || layer == CGWindowLevelForKey(.desktopIconWindow) } public init(pid: Int32, windowNumber: UInt32, layer: Int32 = 0, bounds: CGRect? = nil) { self.pid = pid self.windowNumber = windowNumber self.layer = layer self.bounds = bounds } public static func == (lhs: Self, rhs: Self) -> Bool { lhs.pid == rhs.pid && lhs.windowNumber == rhs.windowNumber && lhs.layer == rhs.layer } } public struct DragSample: Equatable, Sendable { public enum Kind: Sendable { case down, dragged, modifiersChanged, up, cancel, interrupted } public enum Button: Sendable { case left, right } public let button: Button public let kind: Kind public let location: CGPoint public let modifiers: HotKey.Modifiers public let clickCount: Int public let timestamp: Double public let wasClaimed: Bool? public init( kind: Kind, location: CGPoint, modifiers: HotKey.Modifiers = [], clickCount: Int = 1, timestamp: Double = 0, button: Button = .left, wasClaimed: Bool? = nil ) { precondition(clickCount >= 0 && timestamp.isFinite && timestamp >= 0) self.button = button self.kind = kind self.location = location self.modifiers = modifiers self.clickCount = clickCount self.timestamp = timestamp self.wasClaimed = wasClaimed } func claimed(_ value: Bool) -> Self { Self( kind: kind, location: location, modifiers: modifiers, clickCount: clickCount, timestamp: timestamp, button: button, wasClaimed: value) } }