-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from othyn/17-as-a-user-i-would-like-to-be-abl…
…e-to-minimise-the-app-to-a-menubar-icon As a user i would like to be able to minimise the app to a menubar icon
- Loading branch information
Showing
21 changed files
with
547 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
auto-clicker/Extensions/KeyboardShortcuts+Extensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// KeyboardShortcuts+Extensions.swift | ||
// auto-clicker | ||
// | ||
// Created by Ben Tindall on 17/07/2022. | ||
// | ||
|
||
import Foundation | ||
import KeyboardShortcuts | ||
|
||
extension KeyboardShortcuts.Shortcut { | ||
/** | ||
The string representation of the keyboard shortcut key only. | ||
|
||
``` | ||
print(Shortcut(.a, modifiers: [.command])) | ||
//=> "A" | ||
``` | ||
*/ | ||
public var descriptionKeyOnly: String { | ||
// 'keyToCharacter' is inaccessible due to 'fileprivate' protection level | ||
// :( | ||
// modifiers.description + (keyToCharacter()?.uppercased() ?? "�") | ||
|
||
// Hacky due to the above fileprivate protection level of keyToCharacter() | ||
// So just strip the modifier from the string to gain access to a string representation of just the key alone | ||
self.description.replacingOccurrences(of: modifiers.description, with: "") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.