From e7e69b3fd486ff4c5c5f884aef09f00a967e2d06 Mon Sep 17 00:00:00 2001 From: Scott Rice Date: Fri, 1 Jul 2011 12:49:36 +0800 Subject: [PATCH] Fixed issue #1019 in IE --- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index 58ab7269e..c9ed9127b 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -710,7 +710,13 @@ var ModifierKeyCodes = [ // Handle key codes for which String.fromCharCode won't work. if (aDOMEvent.which === 0 || aDOMEvent.charCode === 0) characters = KeyCodesToUnicodeMap[_keyCode]; - + // BUGFIX 1036: + // Checking for a special key breaks in Internet + // Explorer, where both 'which' and 'charCode' are + // undefined instead of 0. We want to replicate + // the above functionality in that environment + if (!characters && (aDOMEvent.which === undefined && aDOMEvent.charCode === undefined)) + characters = KeyCodesToUnicodeMap[_keyCode]; if (!characters) characters = String.fromCharCode(_keyCode).toLowerCase(); @@ -790,10 +796,10 @@ var ModifierKeyCodes = [ // Is this a special key? if (!characters && (aDOMEvent.which === 0 || aDOMEvent.charCode === 0)) characters = KeyCodesToUnicodeMap[charCode]; - + if (!characters) characters = String.fromCharCode(charCode); - + charactersIgnoringModifiers = characters.toLowerCase(); // FIXME: This isn't correct. It SHOULD include Shift. // Safari won't send proper capitalization during cmd-key events