blob: 9f3e367aae583c2ab08d704d39d76812a528e051 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
//
// AppDelegate.m
// Low Battery Yup
//
// Created by TW on 11/16/16.
// Copyright (c) 2016 TW. All rights reserved.
//
#import "AppDelegate.h"
static NSString *const kPreferenceGlobalShortcut = @"GlobalShortcut";
@implementation AppDelegate
- (void)dealloc
{
[super dealloc];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSDictionary *saved_shortcut;
if ((saved_shortcut = [[NSUserDefaults standardUserDefaults] objectForKey:kPreferenceGlobalShortcut])) {
MASShortcut *shortcut = [MASShortcut
shortcutWithKeyCode:[[saved_shortcut objectForKey:@"keyCode"] unsignedIntegerValue]
modifierFlags:[[saved_shortcut objectForKey:@"modifierFlags"] unsignedIntegerValue]];
[_shortcut_view setShortcutValue:shortcut];
}
}
@end
|