-
-
Save spalger/acd24fb970ae17a2a49d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[32md93a45a[m][2015-04-14] Spencer Alger: testing performKeyEquivalent | |
diff --git a/AppDelegate.m b/AppDelegate.m | |
index b8894c3..71212e2 100644 | |
--- a/AppDelegate.m | |
+++ b/AppDelegate.m | |
@@ -178,6 +178,36 @@ | |
} | |
} | |
+- (BOOL)webView:(WebView *)sender performKeyEquivalent:(NSEvent *)theEvent | |
+{ | |
+ NSString * chars = [theEvent characters]; | |
+ BOOL status = NO; | |
+ | |
+ if ([theEvent modifierFlags] & NSCommandKeyMask){ | |
+ | |
+ if ([chars isEqualTo:@"a"]){ | |
+ [sender selectAll:nil]; | |
+ status = YES; | |
+ } | |
+ | |
+ if ([chars isEqualTo:@"c"]){ | |
+ [sender copy:nil]; | |
+ status = YES; | |
+ } | |
+ | |
+ if ([chars isEqualTo:@"v"]){ | |
+ [sender paste:nil]; | |
+ status = YES; | |
+ } | |
+ | |
+ if ([chars isEqualTo:@"x"]){ | |
+ [sender cut:nil]; | |
+ status = YES; | |
+ } | |
+ } | |
+ return status; | |
+} | |
+ | |
#pragma mark - | |
- (void)dealloc { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment