Skip to content

Commit d31c785

Browse files
committed
Update global hotkey
1 parent 43261dd commit d31c785

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

Hidden Bar.xcodeproj/project.pbxproj

+8-8
Original file line numberDiff line numberDiff line change
@@ -558,16 +558,16 @@
558558
CODE_SIGN_IDENTITY = "Mac Developer";
559559
CODE_SIGN_STYLE = Automatic;
560560
COMBINE_HIDPI_IMAGES = YES;
561-
CURRENT_PROJECT_VERSION = 9;
562-
DEVELOPMENT_TEAM = VGURA84Q2L;
561+
CURRENT_PROJECT_VERSION = 10;
562+
DEVELOPMENT_TEAM = W777S7V8TN;
563563
ENABLE_HARDENED_RUNTIME = YES;
564564
INFOPLIST_FILE = hidden/Info.plist;
565565
LD_RUNPATH_SEARCH_PATHS = (
566566
"$(inherited)",
567567
"@executable_path/../Frameworks",
568568
);
569569
MACOSX_DEPLOYMENT_TARGET = 10.12;
570-
MARKETING_VERSION = 1.5;
570+
MARKETING_VERSION = 1.6;
571571
PRODUCT_BUNDLE_IDENTIFIER = com.dwarvesv.minimalbar;
572572
PRODUCT_NAME = "$(TARGET_NAME)";
573573
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -583,16 +583,16 @@
583583
CODE_SIGN_IDENTITY = "Mac Developer";
584584
CODE_SIGN_STYLE = Automatic;
585585
COMBINE_HIDPI_IMAGES = YES;
586-
CURRENT_PROJECT_VERSION = 9;
587-
DEVELOPMENT_TEAM = VGURA84Q2L;
586+
CURRENT_PROJECT_VERSION = 10;
587+
DEVELOPMENT_TEAM = W777S7V8TN;
588588
ENABLE_HARDENED_RUNTIME = YES;
589589
INFOPLIST_FILE = hidden/Info.plist;
590590
LD_RUNPATH_SEARCH_PATHS = (
591591
"$(inherited)",
592592
"@executable_path/../Frameworks",
593593
);
594594
MACOSX_DEPLOYMENT_TARGET = 10.12;
595-
MARKETING_VERSION = 1.5;
595+
MARKETING_VERSION = 1.6;
596596
PRODUCT_BUNDLE_IDENTIFIER = com.dwarvesv.minimalbar;
597597
PRODUCT_NAME = "$(TARGET_NAME)";
598598
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -608,7 +608,7 @@
608608
CODE_SIGN_IDENTITY = "Mac Developer";
609609
CODE_SIGN_STYLE = Automatic;
610610
COMBINE_HIDPI_IMAGES = YES;
611-
DEVELOPMENT_TEAM = VGURA84Q2L;
611+
DEVELOPMENT_TEAM = W777S7V8TN;
612612
ENABLE_HARDENED_RUNTIME = YES;
613613
INFOPLIST_FILE = LauncherApplication/Info.plist;
614614
LD_RUNPATH_SEARCH_PATHS = (
@@ -632,7 +632,7 @@
632632
CODE_SIGN_IDENTITY = "Mac Developer";
633633
CODE_SIGN_STYLE = Automatic;
634634
COMBINE_HIDPI_IMAGES = YES;
635-
DEVELOPMENT_TEAM = VGURA84Q2L;
635+
DEVELOPMENT_TEAM = W777S7V8TN;
636636
ENABLE_HARDENED_RUNTIME = YES;
637637
INFOPLIST_FILE = LauncherApplication/Info.plist;
638638
LD_RUNPATH_SEARCH_PATHS = (

hidden/Features/Preferences/PreferencesViewController.swift

+12-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class PreferencesViewController: NSViewController {
126126
characters: nil,
127127
keyCode: uint32(event.keyCode))
128128

129-
updateKeybindButton(newGlobalKeybind)
129+
updateModifierbindButton(newGlobalKeybind)
130130

131131
}
132132

@@ -148,12 +148,21 @@ class PreferencesViewController: NSViewController {
148148
// Set the shortcut button to show the keys to press
149149
private func updateKeybindButton(_ globalKeybindPreference : GlobalKeybindPreferences) {
150150
btnShortcut.title = globalKeybindPreference.description
151-
152-
if globalKeybindPreference.description.isEmpty {
151+
152+
if globalKeybindPreference.description.count <= 1 {
153153
unregister(nil)
154154
}
155155
}
156156

157+
// Set the shortcut button to show the modifier to press
158+
private func updateModifierbindButton(_ globalKeybindPreference : GlobalKeybindPreferences) {
159+
btnShortcut.title = globalKeybindPreference.description
160+
161+
if globalKeybindPreference.description.isEmpty {
162+
unregister(nil)
163+
}
164+
}
165+
157166
// If a keybind is set, allow users to clear it by enabling the clear button.
158167
private func updateClearButton(_ globalKeybindPreference : GlobalKeybindPreferences?) {
159168
btnClear.isEnabled = globalKeybindPreference != nil

hidden/Models/GlobalKeybindingPreferences.swift

+11
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,20 @@ struct GlobalKeybindPreferences: Codable, CustomStringConvertible {
3939
if self.capsLock {
4040
stringBuilder += ""
4141
}
42+
if keyCode == 36 { // return
43+
stringBuilder += ""
44+
return stringBuilder
45+
}
46+
47+
if keyCode == 51 { // delete
48+
stringBuilder += ""
49+
return stringBuilder
50+
}
51+
4252
if let characters = self.characters {
4353
stringBuilder += characters.uppercased()
4454
}
55+
4556
return "\(stringBuilder)"
4657
}
4758
}

0 commit comments

Comments
 (0)