override init(contentRect: NSRect, styleMask aStyle: NSWindowStyleMask, backing bufferingType:
NSBackingStoreType, defer flag: Bool) {
super.init(contentRect: contentRect, styleMask: aStyle, backing: bufferingType, defer: flag)
isReleasedWhenClosed = true
displaysWhenScreenProfileChanges = true
backgroundColor = NSColor.clear
isOpaque = false
hasShadow = false
collectionBehavior = [.fullScreenPrimary]
isMovable = true
isMovableByWindowBackground = true
styleMask = [NSBorderlessWindowMask, NSResizableWindowMask]
ignoresMouseEvents = false
level = Int(CGWindowLevelForKey(.floatingWindow))
NotificationCenter.default.addObserver(self, selector: #selector(recordButtonDidClick(_:)), name:
NSNotification.Name(rawValue: "CaptureViewRecordButtonDidClick"), object: nil)
setFrame(NSRect(x: 200, y: 200, width: 500, height: 500), display: true)
NSEvent.addLocalMonitorForEvents(matching: .keyDown) { (aEvent) -> NSEvent? in
self.keyDown(with: aEvent)
return aEvent
}
}