aboutsummaryrefslogtreecommitdiffstats
path: root/CopyMailto/QuitButton.m
AgeCommit message (Collapse)Author
2018-09-05Make "Quit" button work on "q" or "Escape" key pressTeddy Wing
Previously I only had a key equivalent on the "Escape" key because you can only set a single key equivalent. But I wanted the "Quit" button to work on both "Escape" and "q" presses. I tried to do this by overriding `performKeyEquivalent:`: - (BOOL)performKeyEquivalent:(NSEvent *)theEvent { if ([[theEvent characters] isEqualToString:@"q"] || [theEvent keyCode] == kVK_Escape) { NSLog(@"%@", theEvent); return YES; } return [super performKeyEquivalent:theEvent]; } The method was called and it logged correctly, but the `IBAction` wouldn't run. Maybe this doesn't work for what I want it to? Can't figure out what the problem is. Didn't want to deal any more so just overrode `keyDown:` instead and got rid of the `IBAction`, just terminating the application in code.