diff --git a/Easydict/Feature/EventMonitor/EZEventMonitor.m b/Easydict/Feature/EventMonitor/EZEventMonitor.m index 1734fa0a4..2578efd37 100644 --- a/Easydict/Feature/EventMonitor/EZEventMonitor.m +++ b/Easydict/Feature/EventMonitor/EZEventMonitor.m @@ -194,8 +194,6 @@ - (void)start { // Monitor global events, Ref: https://blog.csdn.net/ch_soft/article/details/7371136 - (void)startMonitor { - [self monitorCGEventTap]; - [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyDown handler:^NSEvent *_Nullable(NSEvent *_Nonnull event) { if (event.keyCode == kVK_Escape) { // escape NSLog(@"escape"); @@ -302,7 +300,9 @@ - (void)getSelectedText:(BOOL)checkTextFrame completion:(void (^)(NSString *_Nul self.selectTextType = EZSelectTextTypeAccessibility; // Monitor CGEventTap must be required after using Accessibility successfully. - [self monitorCGEventTap]; + if (EZConfiguration.shared.autoSelectText) { + [self monitorCGEventTap]; + } self.selectedTextEditable = [EZSystemUtility isSelectedTextEditable];