aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-10-27 05:48:17 +0200
committerTeddy Wing2018-10-27 05:48:17 +0200
commit90e478bc477edd1b4f871f72ed29d4d1ae4a690b (patch)
treef51328367a9fb834ace86c3e351eaef4f7dab40f
parentcd5b74d2f66c9ad916a216a636769789d5a0354d (diff)
downloadDomeKey-90e478bc477edd1b4f871f72ed29d4d1ae4a690b.tar.bz2
Delete `DKApplication`
This was a test to see if we could get Bluetooth headphone events using media key events. I wasn't successful. Get rid of the code now that it isn't being used.
-rw-r--r--DomeKey.xcodeproj/project.pbxproj6
-rw-r--r--DomeKey/DKApplication.h15
-rw-r--r--DomeKey/DKApplication.m51
-rw-r--r--DomeKey/main.m1
4 files changed, 0 insertions, 73 deletions
diff --git a/DomeKey.xcodeproj/project.pbxproj b/DomeKey.xcodeproj/project.pbxproj
index b78f507..fc25343 100644
--- a/DomeKey.xcodeproj/project.pbxproj
+++ b/DomeKey.xcodeproj/project.pbxproj
@@ -18,7 +18,6 @@
D1E1020821345E2300B2CA29 /* char_to_key_code.m in Sources */ = {isa = PBXBuildFile; fileRef = D1E1020721345E2200B2CA29 /* char_to_key_code.m */; };
D1E1020B21350BAD00B2CA29 /* libdome_key_map.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D1E1020A21350BAD00B2CA29 /* libdome_key_map.a */; };
D1EAA7A421803BB300A0AC35 /* XDG.m in Sources */ = {isa = PBXBuildFile; fileRef = D1EAA7A321803BB300A0AC35 /* XDG.m */; };
- D1FEFD0E21691E5A0054EFE6 /* DKApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = D1FEFD0D21691E5A0054EFE6 /* DKApplication.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -93,8 +92,6 @@
D1E1020C21350D4100B2CA29 /* dome_key_map.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dome_key_map.h; path = "lib/dome-key-map/dome_key_map.h"; sourceTree = SOURCE_ROOT; };
D1EAA7A221803BB300A0AC35 /* XDG.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XDG.h; sourceTree = "<group>"; };
D1EAA7A321803BB300A0AC35 /* XDG.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XDG.m; sourceTree = "<group>"; };
- D1FEFD0C21691E5A0054EFE6 /* DKApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DKApplication.h; sourceTree = "<group>"; };
- D1FEFD0D21691E5A0054EFE6 /* DKApplication.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DKApplication.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -135,8 +132,6 @@
D131C4D121663B6500801267 /* Mappings.h */,
D131C4D221663B6500801267 /* Mappings.m */,
D110C9472122E2D80094F963 /* HeadphoneKey.m */,
- D1FEFD0C21691E5A0054EFE6 /* DKApplication.h */,
- D1FEFD0D21691E5A0054EFE6 /* DKApplication.m */,
D1E101FC2133FA0300B2CA29 /* KeyboardSimulator.h */,
D1E101FD2133FA0300B2CA29 /* KeyboardSimulator.m */,
D160C2A02118EF9D007D1B50 /* main.m */,
@@ -280,7 +275,6 @@
files = (
D131C4D321663B6500801267 /* Mappings.m in Sources */,
D1EAA7A421803BB300A0AC35 /* XDG.m in Sources */,
- D1FEFD0E21691E5A0054EFE6 /* DKApplication.m in Sources */,
D110C9482122E2D80094F963 /* HeadphoneKey.m in Sources */,
D160C2A12118EF9D007D1B50 /* main.m in Sources */,
D11CD06D217FECD9001FCB97 /* AquaticPrime.c in Sources */,
diff --git a/DomeKey/DKApplication.h b/DomeKey/DKApplication.h
deleted file mode 100644
index 70ccd3a..0000000
--- a/DomeKey/DKApplication.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// DKApplication.h
-// DomeKey
-//
-// Created by tw on 10/6/18.
-// Copyright © 2018 tw. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
-@interface DKApplication : NSApplication
-
-- (void)mediaKeyEvent:(int)key state:(BOOL)state repeat:(BOOL)repeat;
-
-@end
diff --git a/DomeKey/DKApplication.m b/DomeKey/DKApplication.m
deleted file mode 100644
index 4098ca7..0000000
--- a/DomeKey/DKApplication.m
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// DKApplication.m
-// DomeKey
-//
-// Created by tw on 10/6/18.
-// Copyright © 2018 tw. All rights reserved.
-//
-
-#import "DKApplication.h"
-
-@implementation DKApplication
-
-// https://weblog.rogueamoeba.com/2007/09/29/
-- (void)sendEvent:(NSEvent *)theEvent
-{
- if ([theEvent type] == NSSystemDefined && [theEvent subtype] == 8) {
- int key_code = (([theEvent data1] & 0xFFFF0000) >> 16);
- int key_flags = ([theEvent data1] & 0x0000FFFF);
- int key_state = (((key_flags & 0xFF00) >> 8)) == 0xA;
- int key_repeat = (key_flags & 0x1);
-
- [self mediaKeyEvent:key_code state:key_state repeat:key_repeat];
- }
-
- [super sendEvent:theEvent];
-}
-
-// https://weblog.rogueamoeba.com/2007/09/29/
-- (void)mediaKeyEvent:(int)key state:(BOOL)state repeat:(BOOL)repeat
-{
- BOOL pressed_and_released = !state;
-
- if (pressed_and_released) {
- switch (key) {
- case NX_KEYTYPE_PLAY:
- NSLog(@"Play");
-
- break;
- case NX_KEYTYPE_FAST:
- NSLog(@"Fast");
-
- break;
- case NX_KEYTYPE_REWIND:
- NSLog(@"Rewind");
-
- break;
- }
- }
-}
-
-@end
diff --git a/DomeKey/main.m b/DomeKey/main.m
index 50070dd..fed870a 100644
--- a/DomeKey/main.m
+++ b/DomeKey/main.m
@@ -10,7 +10,6 @@
#import <Foundation/Foundation.h>
-#import "DKApplication.h"
#import "AppDelegate.h"
#import "LicenseHandler.h"
#import "Mappings.h"