]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
macOS: Get back removing tunnel using the Delete key
authorRoopesh Chander <roop@roopc.net>
Thu, 9 May 2019 13:28:12 +0000 (18:58 +0530)
committerRoopesh Chander <roop@roopc.net>
Mon, 20 May 2019 11:12:27 +0000 (16:42 +0530)
This now works only when the list view has focus

Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift

index 40a2b9e7130680d8045fef23b998ec91eadcafff..982439dda7aa9067dd6290f2fd006a30c49819a4 100644 (file)
@@ -309,6 +309,14 @@ extension TunnelsListTableViewController: NSTableViewDelegate {
     }
 }
 
+extension TunnelsListTableViewController {
+    override func keyDown(with event: NSEvent) {
+        if event.specialKey == .delete {
+            handleRemoveTunnelAction()
+        }
+    }
+}
+
 class FillerButton: NSButton {
     override var intrinsicContentSize: NSSize {
         return NSSize(width: NSView.noIntrinsicMetric, height: NSView.noIntrinsicMetric)