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

Unified Diff: webkit/glue/webinputevent_win.cc

Issue 27332: Fixing WebKeyboardEvent. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « webkit/glue/webinputevent_util.cc ('k') | webkit/glue/webview_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webinputevent_win.cc
===================================================================
--- webkit/glue/webinputevent_win.cc (revision 10793)
+++ webkit/glue/webinputevent_win.cc (working copy)
@@ -6,10 +6,9 @@
#include "webkit/glue/webinputevent.h"
-#include "webkit/glue/event_conversion.h"
-
-#undef LOG
#include "base/logging.h"
+#include "base/string_util.h"
+#include "webkit/glue/webinputevent_util.h"
static const unsigned long kDefaultScrollLinesPerWheelDelta = 3;
@@ -177,9 +176,9 @@
// message == WM_HSCROLL, wparam == SB_LINELEFT (== SB_LINEUP).
// * Scrolling right
// message == WM_HSCROLL, wparam == SB_LINERIGHT (== SB_LINEDOWN).
- if (WM_HSCROLL == message) {
- key_state |= MK_SHIFT;
- wheel_delta = -wheel_delta;
+ if (WM_HSCROLL == message) {
+ key_state |= MK_SHIFT;
+ wheel_delta = -wheel_delta;
}
// Use GetAsyncKeyState for key state since we are synthesizing
@@ -310,13 +309,13 @@
actual_message.wParam = wparam;
actual_message.lParam = lparam;
- key_code = static_cast<int>(wparam);
+ windows_key_code = native_key_code = static_cast<int>(wparam);
switch (message) {
case WM_SYSKEYDOWN:
system_key = true;
case WM_KEYDOWN:
- type = KEY_DOWN;
+ type = RAW_KEY_DOWN;
break;
case WM_SYSKEYUP:
system_key = true;
@@ -336,6 +335,21 @@
NOTREACHED() << "unexpected native message: " << message;
}
+ memset(&text, 0, sizeof(text));
+ memset(&unmodified_text, 0, sizeof(unmodified_text));
+ memset(&key_identifier, 0, sizeof(key_identifier));
+
+ if (type == CHAR || type == RAW_KEY_DOWN) {
+ text[0] = windows_key_code;
+ unmodified_text[0] = windows_key_code;
+ }
+ if (type != CHAR) {
+ std::string key_identifier_str =
+ webkit_glue::GetKeyIdentifierForWindowsKeyCode(windows_key_code);
+ base::strlcpy(key_identifier, key_identifier_str.c_str(),
+ kIdentifierLengthCap);
+ }
+
if (GetKeyState(VK_SHIFT) & 0x8000)
modifiers |= SHIFT_KEY;
if (GetKeyState(VK_CONTROL) & 0x8000)
« no previous file with comments | « webkit/glue/webinputevent_util.cc ('k') | webkit/glue/webview_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698