aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DomeKey.xcodeproj/project.pbxproj6
-rw-r--r--DomeKey.xcodeproj/xcuserdata/tw.xcuserdatad/xcschemes/xcschememanagement.plist2
-rw-r--r--DomeKey/AppDelegate.h16
-rw-r--r--DomeKey/AppDelegate.m18
-rw-r--r--DomeKey/main.m10
5 files changed, 47 insertions, 5 deletions
diff --git a/DomeKey.xcodeproj/project.pbxproj b/DomeKey.xcodeproj/project.pbxproj
index 6f61405..ff696e3 100644
--- a/DomeKey.xcodeproj/project.pbxproj
+++ b/DomeKey.xcodeproj/project.pbxproj
@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
D110C9482122E2D80094F963 /* HeadphoneKey.m in Sources */ = {isa = PBXBuildFile; fileRef = D110C9472122E2D80094F963 /* HeadphoneKey.m */; };
D110C94A2122F1ED0094F963 /* libddhid.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D160C32221197983007D1B50 /* libddhid.a */; };
+ D11184622125206E00961687 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D11184612125206E00961687 /* AppDelegate.m */; };
D160C2A12118EF9D007D1B50 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D160C2A02118EF9D007D1B50 /* main.m */; };
/* End PBXBuildFile section */
@@ -65,6 +66,8 @@
/* Begin PBXFileReference section */
D110C9462122E2D80094F963 /* HeadphoneKey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HeadphoneKey.h; sourceTree = "<group>"; };
D110C9472122E2D80094F963 /* HeadphoneKey.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HeadphoneKey.m; sourceTree = "<group>"; };
+ D11184602125206E00961687 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ D11184612125206E00961687 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
D160C29D2118EF9D007D1B50 /* DomeKey */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DomeKey; sourceTree = BUILT_PRODUCTS_DIR; };
D160C2A02118EF9D007D1B50 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
D160C31521197983007D1B50 /* DDHidLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = DDHidLib.xcodeproj; path = lib/DDHidLib/DDHidLib.xcodeproj; sourceTree = "<group>"; };
@@ -105,6 +108,8 @@
D110C9462122E2D80094F963 /* HeadphoneKey.h */,
D110C9472122E2D80094F963 /* HeadphoneKey.m */,
D160C2A02118EF9D007D1B50 /* main.m */,
+ D11184602125206E00961687 /* AppDelegate.h */,
+ D11184612125206E00961687 /* AppDelegate.m */,
);
path = DomeKey;
sourceTree = "<group>";
@@ -225,6 +230,7 @@
files = (
D110C9482122E2D80094F963 /* HeadphoneKey.m in Sources */,
D160C2A12118EF9D007D1B50 /* main.m in Sources */,
+ D11184622125206E00961687 /* AppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/DomeKey.xcodeproj/xcuserdata/tw.xcuserdatad/xcschemes/xcschememanagement.plist b/DomeKey.xcodeproj/xcuserdata/tw.xcuserdatad/xcschemes/xcschememanagement.plist
index 1112607..424ba24 100644
--- a/DomeKey.xcodeproj/xcuserdata/tw.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/DomeKey.xcodeproj/xcuserdata/tw.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -7,7 +7,7 @@
<key>DomeKey.xcscheme</key>
<dict>
<key>orderHint</key>
- <integer>1</integer>
+ <integer>0</integer>
</dict>
</dict>
</dict>
diff --git a/DomeKey/AppDelegate.h b/DomeKey/AppDelegate.h
new file mode 100644
index 0000000..6b1d9a4
--- /dev/null
+++ b/DomeKey/AppDelegate.h
@@ -0,0 +1,16 @@
+//
+// AppDelegate.h
+// DomeKey
+//
+// Created by tw on 8/16/18.
+// Copyright © 2018 tw. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "HeadphoneKey.h"
+
+@interface AppDelegate : NSObject <NSApplicationDelegate> {
+ HeadphoneKey *_headphone_key;
+}
+
+@end
diff --git a/DomeKey/AppDelegate.m b/DomeKey/AppDelegate.m
new file mode 100644
index 0000000..3e4f3d8
--- /dev/null
+++ b/DomeKey/AppDelegate.m
@@ -0,0 +1,18 @@
+//
+// AppDelegate.m
+// DomeKey
+//
+// Created by tw on 8/16/18.
+// Copyright © 2018 tw. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+- (void)applicationDidFinishLaunching:(NSNotification *)notification
+{
+ _headphone_key = [[HeadphoneKey alloc] init];
+}
+
+@end
diff --git a/DomeKey/main.m b/DomeKey/main.m
index 27df36e..e61929c 100644
--- a/DomeKey/main.m
+++ b/DomeKey/main.m
@@ -7,16 +7,18 @@
//
#import <Foundation/Foundation.h>
-#import "HeadphoneKey.h"
+#import "AppDelegate.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
+ [NSApplication sharedApplication];
+ AppDelegate *app = [[AppDelegate alloc] init];
+ [NSApp setDelegate:app];
+
// insert code here...
NSLog(@"Hello, World!");
- HeadphoneKey *h = [[HeadphoneKey alloc] init];
- while (YES) {
- }
+ [NSApp run];
}
return 0;
}