Created
November 7, 2010 21:41
-
-
Save fabi1cazenave/666875 to your computer and use it in GitHub Desktop.
asymetric Meta keys with MacVim
This file contains hidden or 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
diff --git a/src/MacVim/MMTextViewHelper.m b/src/MacVim/MMTextViewHelper.m | |
index 4d10432..42f311b 100644 | |
--- a/src/MacVim/MMTextViewHelper.m | |
+++ b/src/MacVim/MMTextViewHelper.m | |
@@ -22,6 +22,9 @@ | |
#import "MMWindowController.h" | |
#import "Miscellaneous.h" | |
+// asymetric meta keys | |
+#define NSLeftAlternateKeyMask (0x000020 | NSAlternateKeyMask) | |
+#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask) | |
// The max/min drag timer interval in seconds | |
static NSTimeInterval MMDragTimerMaxInterval = 0.3; | |
@@ -165,7 +168,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b) | |
// ASCII chars in the range after space (0x20) and before backspace (0x7f). | |
// Note that this implies that 'mmta' (if enabled) breaks input methods | |
// when the Alt key is held. | |
- if ((flags & NSAlternateKeyMask) && [mmta boolValue] && [unmod length] == 1 | |
+ if (((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) | |
+ && [mmta boolValue] && [unmod length] == 1 | |
&& [unmod characterAtIndex:0] > 0x20 | |
&& [unmod characterAtIndex:0] < 0x7f) { | |
ASLogDebug(@"MACMETA key, don't interpret it"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment