aboutsummaryrefslogtreecommitdiffstats
path: root/Low Battery Yup d/AppDelegate.m
diff options
context:
space:
mode:
Diffstat (limited to 'Low Battery Yup d/AppDelegate.m')
-rw-r--r--Low Battery Yup d/AppDelegate.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/Low Battery Yup d/AppDelegate.m b/Low Battery Yup d/AppDelegate.m
index 0a7d2a3..51c1626 100644
--- a/Low Battery Yup d/AppDelegate.m
+++ b/Low Battery Yup d/AppDelegate.m
@@ -7,7 +7,9 @@
//
#import "AppDelegate.h"
+#import "DDHotKeyCenter.h"
#import "Mouse.h"
+#import <Carbon/Carbon.h>
@implementation AppDelegate
@@ -18,6 +20,16 @@
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
+ DDHotKeyCenter *hotkey_center = [DDHotKeyCenter sharedHotKeyCenter];
+ [hotkey_center registerHotKeyWithKeyCode:kVK_ANSI_0
+ modifierFlags:(NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask)
+ target:self
+ action:@selector(dismissLowBatteryWarning:)
+ object:nil];
+}
+
+- (void)dismissLowBatteryWarning:(NSEvent *)hotKeyEvent
+{
Mouse *m = [[Mouse alloc] init];
[m moveToLowBatteryOK];
[m click];