summaryrefslogtreecommitdiffstats
path: root/webkit/api
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 22:25:00 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 22:25:00 +0000
commit47d4f37a0626172d212b23d8b973e0a20a89b957 (patch)
treed370e15b8edc1c33c7cd60885bdde148a7fe994b /webkit/api
parent31ed7405f8b89b3bdf5ebedc3f45d45eb4b648a2 (diff)
downloadchromium_src-47d4f37a0626172d212b23d8b973e0a20a89b957.zip
chromium_src-47d4f37a0626172d212b23d8b973e0a20a89b957.tar.gz
chromium_src-47d4f37a0626172d212b23d8b973e0a20a89b957.tar.bz2
Mac: Fix assertion failure on pressing the fn-key (and increase robustness).
Patch by viettrungluu. BUG=http://crbug.com/18796 TEST=On a Mac with an fn key, give the web page keyboard focus and press the fn key. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api')
-rw-r--r--webkit/api/src/mac/WebInputEventFactory.mm23
1 files changed, 20 insertions, 3 deletions
diff --git a/webkit/api/src/mac/WebInputEventFactory.mm b/webkit/api/src/mac/WebInputEventFactory.mm
index b549c5f..74a7a87 100644
--- a/webkit/api/src/mac/WebInputEventFactory.mm
+++ b/webkit/api/src/mac/WebInputEventFactory.mm
@@ -151,6 +151,11 @@ static int windowsKeyCodeForKeyEvent(NSEvent* event)
case 62: // Right Ctrl
return 0x11;
+// Begin non-Apple addition ---------------------------------------------------
+ case 63: // Function (no Windows key code)
+ return 0;
+// End non-Apple addition -----------------------------------------------------
+
// VK_CLEAR (0C) CLEAR key
case 71: return 0x0C;
@@ -187,6 +192,14 @@ static int windowsKeyCodeForKeyEvent(NSEvent* event)
case 75: return 0x6F;
}
+// Begin non-Apple addition ---------------------------------------------------
+ // |-[NSEvent charactersIgnoringModifiers]| isn't allowed for
+ // NSFlagsChanged, and conceivably we may not have caught everything
+ // which causes an NSFlagsChanged above.
+ if ([event type] == NSFlagsChanged)
+ return 0;
+// End non-Apple addition -----------------------------------------------------
+
NSString* s = [event charactersIgnoringModifiers];
if ([s length] != 1)
return 0;
@@ -523,9 +536,13 @@ static NSString* keyIdentifierForKeyEvent(NSEvent* event)
case 62: // Right Ctrl
return @"Control";
- default:
- ASSERT_NOT_REACHED();
- return @"";
+// Begin non-Apple addition/modification --------------------------------------
+ case 63: // Function
+ return @"Function";
+
+ default: // Unknown, but this may be a strange/new keyboard.
+ return @"Unidentified";
+// End non-Apple addition/modification ----------------------------------------
}
}