aboutsummaryrefslogtreecommitdiffstats
path: root/Low Battery Yup/ShortcutView.m
blob: 3dc2ff38fa57fd150315f86a2644acf68a637bcb (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
//
//  ShortcutView.m
//  Low Battery Yup.d
//
//  Created by TW on 12/1/16.
//  Copyright (c) 2016 TW. All rights reserved.
//

#import "ShortcutView.h"
#import "Constants.h"

@implementation ShortcutView

- (void)setShortcutValue:(MASShortcut *)shortcutValue
{
	[super setShortcutValue:shortcutValue];

	NSDictionary *shortcut = [NSDictionary dictionaryWithObjectsAndKeys:
		[NSNumber numberWithInteger:[shortcutValue keyCode]], @"keyCode",
		[NSNumber numberWithInteger:[shortcutValue modifierFlags]], @"modifierFlags",
		nil];

	[[NSUserDefaults standardUserDefaults] setObject:shortcut forKey:kPreferenceGlobalShortcut];
}

@end