Browse Source

Fix media key hook for Mojave.

master
parent
commit
9606567b03
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      Application/MediaKeysApplication.m

+ 4
- 8
Application/MediaKeysApplication.m View File

@@ -35,16 +35,12 @@
if([SPMediaKeyTap usesGlobalMediaKeyTap]) {
if (![keyTap startWatchingMediaKeys]) {
NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"Retry"];
[alert addButtonWithTitle:@"Cancel"];
[alert addButtonWithTitle:@"OK"];
[alert setMessageText:@"Enable Media Key access?"];
[alert setInformativeText:@"Media Key support requires the \"Accessibility\" permission."];
[alert setInformativeText:@"Media Key support requires the \"Accessibility\" permission. You will need to restart the application for the change to take effect."];
[alert setAlertStyle:NSInformationalAlertStyle];
if ([alert runModal] == NSAlertFirstButtonReturn) {
NSString *path = [[NSBundle mainBundle] executablePath];
NSString *processID = [NSString stringWithFormat:@"%d",[[NSProcessInfo processInfo] processIdentifier]];
[NSTask launchedTaskWithLaunchPath:path arguments:[NSArray arrayWithObjects:path,processID,nil]];
}
[alert runModal];
ALog(@"Media key monitoring disabled until application is restarted");
}
}
else


Loading…
Cancel
Save