From baa8ad7f750dd56422dfa85b4015283d4948600a Mon Sep 17 00:00:00 2001 From: Econa77 Date: Thu, 26 Jul 2018 16:15:01 +0900 Subject: [PATCH] Support cancellation of editing with ESC key (#22) --- Lib/KeyHolder/RecordView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/KeyHolder/RecordView.swift b/Lib/KeyHolder/RecordView.swift index d43bb97..f1a4383 100644 --- a/Lib/KeyHolder/RecordView.swift +++ b/Lib/KeyHolder/RecordView.swift @@ -225,6 +225,10 @@ extension NSColor { } } + open override func cancelOperation(_ sender: Any?) { + endRecording() + } + override open func keyDown(with theEvent: NSEvent) { if !performKeyEquivalent(with: theEvent) { super.keyDown(with: theEvent) } }