aboutsummaryrefslogtreecommitdiffstats
path: root/DDHotKey/DDHotKeyTextField.h
diff options
context:
space:
mode:
authorTeddy Wing2016-11-18 22:54:19 -0500
committerTeddy Wing2016-11-18 22:54:19 -0500
commit678f8ca1a961eb9125aa82b7d2277fda4db7f146 (patch)
treeaad4444f63e18aa9b8e10e05874f0612c4f93e7a /DDHotKey/DDHotKeyTextField.h
parent7677b59543a8d2edc9a28f77f26ebb02492e2b5c (diff)
downloadLow-Battery-Yup-678f8ca1a961eb9125aa82b7d2277fda4db7f146.tar.bz2
Use hard-coded hotkey to invoke battery dialog dismisser
* Add DDHotKey library to the project. Just copy the files in from the latest HEAD@e0481f648e0bc7e55d183622b00510b6721152d8. * Only add DDHotKeyCenter.{h,m} & DDHotKeyUtilities.{h,m} to the "Low Battery Yup.d" target as the *TextField file is only useful for a UI to choose a hotkey, and we don't have a UI in this target. * Set the DDHotKey* files to use ARC when compiling since they require it. This was done by going to Build Phases -> Compile Sources and adding this flag for both files: -fobj-arc this I figured out thanks to the following SO post: http://stackoverflow.com/questions/6448874/disable-automatic-reference-counting-for-some-files/10255815#10255815 * Link Carbon.framework because DDHotKey depends on it to register global hotkeys * Move our mouse moving & clicking code to a new method that gets used as the global hotkey action * Fix a runtime error caused by MainMenu.xib not being available (as a result of f0e8b5188e6fb984511eb01849380669e69632a6). To do this, we modify `main.m` to bypass the check for MainMenu.xib as described in this SO post: http://stackoverflow.com/questions/6945872/cocoa-app-without-a-mainmenu-xib/6946016#6946016 * Delete the `window` `IBOutlet` since we no longer have a MainMenu.xib and don't have a window in this app.
Diffstat (limited to 'DDHotKey/DDHotKeyTextField.h')
-rw-r--r--DDHotKey/DDHotKeyTextField.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/DDHotKey/DDHotKeyTextField.h b/DDHotKey/DDHotKeyTextField.h
new file mode 100644
index 0000000..c399d62
--- /dev/null
+++ b/DDHotKey/DDHotKeyTextField.h
@@ -0,0 +1,20 @@
+/*
+ DDHotKey -- DDHotKeyTextField.h
+
+ Copyright (c) Dave DeLong <http://www.davedelong.com>
+
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+ The software is provided "as is", without warranty of any kind, including all implied warranties of merchantability and fitness. In no event shall the author(s) or copyright holder(s) be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
+ */
+
+#import <Foundation/Foundation.h>
+#import "DDHotKeyCenter.h"
+
+@interface DDHotKeyTextField : NSTextField
+
+@property (nonatomic, strong) DDHotKey *hotKey;
+
+@end
+
+@interface DDHotKeyTextFieldCell : NSTextFieldCell @end \ No newline at end of file