2016-04-08 监听全局事件 1234567891011121314151617181920[NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyUpMask handler:^(NSEvent * _Nonnull event) { [self handleEvent:event]; }]; -(BOOL) handleEvent:(NSEvent *) event{const NSUInteger kNotAlt = NSAlternateKeyMask | NSShiftKeyMask | NSCommandKeyMask; if ((event.modifierFlags & NSControlKeyMask) != 0 && ((event.modifierFlags & kNotAlt) == 0) && [event.charactersIgnoringModifiers isEqualToString:@"x"]) { ..... // 激活app [NSApp activateIgnoringOtherApps:YES]; return YES; } return NO;} Récent bash history Ancien AVAuthorizationStatus Camera