Index: iTermApplication.m
===================================================================
RCS file: /cvsroot/iterm/iTerm/iTermApplication.m,v
retrieving revision 1.10
diff -u -r1.10 iTermApplication.m
--- iTermApplication.m	7 Nov 2006 08:03:08 -0000	1.10
+++ iTermApplication.m	5 Nov 2007 13:51:06 -0000
@@ -43,6 +43,10 @@
 	id aWindow;
 	PseudoTerminal *currentTerminal;
 	PTYSession *currentSession;
+	unsigned int modflag;
+	unichar unicode;
+	NSString *keystr;
+	NSEvent *newEvent;
 	
 		
 	if([anEvent type] == NSKeyDown)
@@ -57,16 +61,42 @@
 			currentSession = [currentTerminal currentSession];
 			
 			if([currentSession hasKeyMappingForEvent: anEvent highPriority: YES])
+			{
 				[currentSession keyDown: anEvent];
-			else
-				[super sendEvent: anEvent];
-		}
-		else
-		   [super sendEvent: anEvent];
+				return;
+			}
+
+			modflag = [anEvent modifierFlags];
+
+			if ((modflag & NSCommandKeyMask)) {
+				keystr  = [anEvent characters];
+				unicode = [keystr length] > 0 ? [keystr characterAtIndex : 0] : 0;
 
+				switch (unicode)
+				{
+					case 0x20:						// Switch Input Source
+					case NSCarriageReturnCharacter:	// Enter Full Screen
+						break;
+
+					default:
+						newEvent = [NSEvent keyEventWithType: [anEvent type]
+											location: [anEvent locationInWindow]
+											modifierFlags: ((modflag - NSCommandKeyMask) | NSAlternateKeyMask)
+											timestamp: [anEvent timestamp]
+											windowNumber: [anEvent windowNumber]
+											context: [anEvent context]
+											characters: keystr
+											charactersIgnoringModifiers: [anEvent charactersIgnoringModifiers]
+											isARepeat: [anEvent isARepeat]
+											keyCode: [anEvent keyCode]];
+						[currentSession keyDown: newEvent];
+						return;
+				}
+			}
+		}
 	}
-	else
-		[super sendEvent: anEvent];
+
+	[super sendEvent: anEvent];
 }
 
 @end
