mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Added hack to make Ctrl-Tab work on pre 10.5 systems
git-svn-id: http://macvim.googlecode.com/svn/trunk@315 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
@@ -10,6 +10,12 @@
|
||||
|
||||
#import "MMApplication.h"
|
||||
|
||||
// Ctrl-Tab is broken on pre 10.5, so we add a hack to make it work.
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
|
||||
# import "MMTextView.h"
|
||||
# define MM_CTRL_TAB_HACK 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +26,19 @@
|
||||
NSEventType type = [event type];
|
||||
unsigned flags = [event modifierFlags];
|
||||
|
||||
#ifdef MM_CTRL_TAB_HACK
|
||||
NSResponder *firstResponder = [[self keyWindow] firstResponder];
|
||||
|
||||
if (NSKeyDown == type && NSControlKeyMask & flags && 48 == [event keyCode]
|
||||
&& [firstResponder isKindOfClass:[MMTextView class]]) {
|
||||
// HACK! This is a Ctrl-Tab key down event and the first responder is
|
||||
// an MMTextView; send the event directly to the text view, else it
|
||||
// will never receive it on pre 10.5 systems.
|
||||
[firstResponder keyDown:event];
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// HACK! Intercept 'help' key presses and clear the 'help key flag', else
|
||||
// Cocoa turns the mouse cursor into a question mark and goes into 'context
|
||||
// help mode' (the keyDown: event itself never reaches the text view). By
|
||||
|
||||
Reference in New Issue
Block a user