1 /* vi:set ts=8 sts=4 sw=4 ft=objc:
3 * VIM - Vi IMproved by Bram Moolenaar
4 * MacVim GUI port by Bjorn Winckler
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
11 #import "MMApplication.h"
16 @implementation MMApplication
18 - (void)sendEvent:(NSEvent *)event
20 NSEventType type = [event type];
21 unsigned flags = [event modifierFlags];
23 // HACK! Intercept 'help' key presses and clear the 'help key flag', else
24 // Cocoa turns the mouse cursor into a question mark and goes into 'context
25 // help mode' (the keyDown: event itself never reaches the text view). By
26 // clearing the 'help key flag' this event will be treated like a normal
28 if ((NSKeyDown == type || NSKeyUp == type) && (flags & NSHelpKeyMask)) {
29 flags &= ~NSHelpKeyMask;
30 event = [NSEvent keyEventWithType:[event type]
31 location:[event locationInWindow]
33 timestamp:[event timestamp]
34 windowNumber:[event windowNumber]
35 context:[event context]
36 characters:[event characters]
37 charactersIgnoringModifiers:[event charactersIgnoringModifiers]
38 isARepeat:[event isARepeat]
39 keyCode:[event keyCode]];
42 [super sendEvent:event];