From: Roopesh Chander Date: Thu, 9 May 2019 13:28:12 +0000 (+0530) Subject: macOS: Get back removing tunnel using the Delete key X-Git-Tag: 0.0.20190531-9~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f25d54dcc60fdb919b8cd7ef10ec502f3eaab7b;p=thirdparty%2Fwireguard-apple.git macOS: Get back removing tunnel using the Delete key This now works only when the list view has focus Signed-off-by: Roopesh Chander --- 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)