Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: webkit/api/src/WebInputEventConversion.cpp

Issue 269084: Allow keyboard input to work in Mac plugins.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/api/src/WebPluginContainerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/WebInputEventConversion.cpp
===================================================================
--- webkit/api/src/WebInputEventConversion.cpp (revision 29397)
+++ webkit/api/src/WebInputEventConversion.cpp (working copy)
@@ -237,12 +237,20 @@
type = KeyDown;
else if (event.type() == eventNames().keyupEvent)
type = WebInputEvent::KeyUp;
+ else if (event.type() == eventNames().keypressEvent)
+ type = WebInputEvent::Char;
else
return; // Skip all other keyboard events.
modifiers = getWebInputModifiers(event);
timeStampSeconds = event.timeStamp() * 1.0e-3;
windowsKeyCode = event.keyCode();
nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode();
+ unsigned int numChars = std::min(event.keyEvent()->text().length(),
+ static_cast<unsigned int>(WebKeyboardEvent::textLengthCap));
+ for (unsigned int i = 0; i < numChars; i++) {
+ text[i] = event.keyEvent()->text()[i];
+ unmodifiedText[i] = event.keyEvent()->unmodifiedText()[i];
+ }
}
} // namespace WebKit
« no previous file with comments | « no previous file | webkit/api/src/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698