Skip to content

Commit 9a5d937

Browse files
committed
feat: enhance GlobalHotkeyService with additional keyboard shortcuts - Added new quarter window management shortcuts to GlobalHotkeyService.swift for improved user functionality and experience. Updated project settings to enable optimization profile for better performance.
1 parent a1e9bbb commit 9a5d937

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

MacSnapper.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@
390390
buildSettings = {
391391
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
392392
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
393+
CLANG_USE_OPTIMIZATION_PROFILE = YES;
393394
CODE_SIGN_ENTITLEMENTS = MacSnapper/MacSnapper.entitlements;
394395
CODE_SIGN_STYLE = Automatic;
395396
CURRENT_PROJECT_VERSION = 1;
@@ -429,6 +430,7 @@
429430
buildSettings = {
430431
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
431432
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
433+
CLANG_USE_OPTIMIZATION_PROFILE = YES;
432434
CODE_SIGN_ENTITLEMENTS = MacSnapper/MacSnapper.entitlements;
433435
CODE_SIGN_STYLE = Automatic;
434436
CURRENT_PROJECT_VERSION = 1;

MacSnapper/Infrastructure/Services/GlobalHotkeyService.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ public final class GlobalHotkeyService: ObservableObject {
4343
(.maximize, 36, UInt32(optionKey | controlKey)), // ⌥⌃ + Enter (Return)
4444
(.center, 8, UInt32(optionKey | controlKey)), // ⌥⌃ + C
4545

46-
// Quarters
46+
47+
// Quarters
48+
(.topLeftQuarter, 32, UInt32(optionKey | controlKey)), // ⌥⌃ + U
49+
(.topRightQuarter, 34, UInt32(optionKey | controlKey)), // ⌥⌃ + I
50+
(.bottomLeftQuarter, 38, UInt32(optionKey | controlKey)), // ⌥⌃ + J
51+
(.bottomRightQuarter, 40, UInt32(optionKey | controlKey)) ,
52+
// ⌥⌃ + K
4753
(.topLeftQuarter, 18, UInt32(optionKey | controlKey)), // ⌥⌃ + 1
4854
(.topRightQuarter, 19, UInt32(optionKey | controlKey)), // ⌥⌃ + 2
4955
(.bottomLeftQuarter, 20, UInt32(optionKey | controlKey)), // ⌥⌃ + 3
@@ -119,8 +125,7 @@ public final class GlobalHotkeyService: ObservableObject {
119125
selfPtr,
120126
&eventHandler
121127
)
122-

123-
128+
124129
if status != noErr {
125130
logger.error("Failed to install event handler: \(status)")
126131
registrationError = "Failed to install global event handler"

0 commit comments

Comments
 (0)