diff options
Diffstat (limited to 'Low Battery Yup/ShortcutView.m')
| -rw-r--r-- | Low Battery Yup/ShortcutView.m | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Low Battery Yup/ShortcutView.m b/Low Battery Yup/ShortcutView.m new file mode 100644 index 0000000..3dc2ff3 --- /dev/null +++ b/Low Battery Yup/ShortcutView.m @@ -0,0 +1,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 |
