From 33b9ffa74b0b2ce15ed6fd2e0c0304bf66b1ee42 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Thu, 9 May 2019 18:58:12 +0530 Subject: [PATCH] macOS: Get back removing tunnel using the Delete key This now works only when the list view has focus --- .../ViewController/TunnelsListTableViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift index 40a2b9e..982439d 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift @@ -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)