Cleaned up paths table.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import Cocoa
|
||||
|
||||
protocol EditableNSTextFieldDelegate: AnyObject {
|
||||
func lostFocus()
|
||||
}
|
||||
|
||||
final class EditableNSTextField: NSTextField {
|
||||
private let commandKey = NSEvent.ModifierFlags.command.rawValue
|
||||
private let commandShiftKey = NSEvent.ModifierFlags.command.rawValue |
|
||||
NSEvent.ModifierFlags.shift.rawValue
|
||||
|
||||
weak var auxiliaryDelegate: EditableNSTextFieldDelegate?
|
||||
|
||||
override func performKeyEquivalent(with event: NSEvent) -> Bool {
|
||||
if event.type == NSEvent.EventType.keyDown {
|
||||
if (event.modifierFlags.rawValue &
|
||||
@@ -50,4 +56,8 @@ final class EditableNSTextField: NSTextField {
|
||||
}
|
||||
return super.performKeyEquivalent(with: event)
|
||||
}
|
||||
|
||||
override func textDidEndEditing(_ notification: Notification) {
|
||||
auxiliaryDelegate?.lostFocus()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user