Macでウィンドウ透過後もキー操作を受け付けられるようになった。

This commit is contained in:
Kirurobo
2020-12-05 23:34:17 +09:00
parent f6e93c7736
commit 477fefa3f7
3 changed files with 11 additions and 1 deletions

View File

@@ -40,6 +40,16 @@ class OverlayView: NSView {
)
self.wantsLayer = false
self.needsDisplay = false
}
override public var acceptsFirstResponder: Bool { return false }
override public var canBecomeKeyView: Bool { return false }
override public var isOpaque: Bool { return false }
/// Need to return nil to send keystrokes to the Unity view when the window is transparent
override func hitTest(_ point: NSPoint) -> NSView? {
return nil
}
/// Set constraints to fit the window