Close preference pane using cmd+w (#645)

This commit is contained in:
Joni Van Roost 2021-10-01 20:28:22 +02:00 committed by GitHub
parent 438d60128a
commit 1ec444460c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -1,5 +1,7 @@
// Copyright © MonitorControl. @JoniVR, @theOneyouseek, @waydabber and others
import Cocoa
import Preferences
extension Preferences.PaneIdentifier {
@ -9,3 +11,13 @@ extension Preferences.PaneIdentifier {
static let displays = Self("Displays")
static let about = Self("About")
}
public extension PreferencesWindowController {
override func keyDown(with event: NSEvent) {
if event.modifierFlags.intersection(.deviceIndependentFlagsMask) == .command, let key = event.charactersIgnoringModifiers {
if key == "w" {
self.close()
}
}
}
}

View file

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>6293</string>
<string>6295</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>

View file

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>6293</string>
<string>6295</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSBackgroundOnly</key>