mirror of
https://github.com/objective-see/TaskExplorer.git
synced 2026-03-22 07:02:39 +00:00
filter background processing support for filtering when enter is hit after trying full #keyword 'not found' binary attribute/#keyword error alert when opening file in Finder fails skipper dylib/file/network enumeration for kernel task (pid 0x0)
41 lines
1.4 KiB
Objective-C
41 lines
1.4 KiB
Objective-C
//
|
|
// NSApplicationKeyEvents.m
|
|
// TaskExplorer
|
|
//
|
|
// Created by Patrick Wardle on 7/11/15.
|
|
// Copyright (c) 2015 Objective-See. All rights reserved.
|
|
//
|
|
|
|
#import "NSApplicationKeyEvents.h"
|
|
|
|
@implementation NSApplicationKeyEvents
|
|
|
|
//to enable copy/paste etc even though we don't have an 'Edit' menu
|
|
// details: http://stackoverflow.com/questions/970707/cocoa-keyboard-shortcuts-in-dialog-without-an-edit-menu
|
|
-(void) sendEvent:(NSEvent *)event {
|
|
if ([event type] == NSKeyDown) {
|
|
if (([event modifierFlags] & NSDeviceIndependentModifierFlagsMask) == NSCommandKeyMask) {
|
|
if ([[event charactersIgnoringModifiers] isEqualToString:@"x"]) {
|
|
if ([self sendAction:@selector(cut:) to:nil from:self])
|
|
return;
|
|
}
|
|
else if ([[event charactersIgnoringModifiers] isEqualToString:@"c"]) {
|
|
if ([self sendAction:@selector(copy:) to:nil from:self])
|
|
return;
|
|
}
|
|
else if ([[event charactersIgnoringModifiers] isEqualToString:@"v"]) {
|
|
if ([self sendAction:@selector(paste:) to:nil from:self])
|
|
return;
|
|
}
|
|
else if ([[event charactersIgnoringModifiers] isEqualToString:@"a"]) {
|
|
if ([self sendAction:@selector(selectAll:) to:nil from:self])
|
|
return;
|
|
}
|
|
}
|
|
|
|
}
|
|
[super sendEvent:event];
|
|
}
|
|
|
|
@end
|