Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (18 sloc) 999 Bytes
#import "AXCVHandler.h"
@implementation AXCVHandler
- (BOOL)performKeyEquivalent:(NSEvent *)event {
if (([event modifierFlags] & NSDeviceIndependentModifierFlagsMask) == NSCommandKeyMask) {
// The command key is the ONLY modifier key being pressed.
if ([[event charactersIgnoringModifiers] isEqualToString:@"x"]) {
return [NSApp sendAction:@selector(cut:) to:[[self window] firstResponder] from:self];
} else if ([[event charactersIgnoringModifiers] isEqualToString:@"c"]) {
return [NSApp sendAction:@selector(copy:) to:[[self window] firstResponder] from:self];
} else if ([[event charactersIgnoringModifiers] isEqualToString:@"v"]) {
return [NSApp sendAction:@selector(paste:) to:[[self window] firstResponder] from:self];
} else if ([[event charactersIgnoringModifiers] isEqualToString:@"a"]) {
return [NSApp sendAction:@selector(selectAll:) to:[[self window] firstResponder] from:self];
}
}
return [super performKeyEquivalent:event];
}
@end
Something went wrong with that request. Please try again.