summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webinputevent_win.cc
diff options
context:
space:
mode:
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 17:44:26 +0000
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 17:44:26 +0000
commit34ebfbc2573c29e3c49a4ed8689b6daccb19471b (patch)
tree16b103968cf6779162bbc0eb01b273696e81fc49 /webkit/glue/webinputevent_win.cc
parent08090a8f2588b1e03c3766fd676b5a19824d5b62 (diff)
downloadchromium_src-34ebfbc2573c29e3c49a4ed8689b6daccb19471b.zip
chromium_src-34ebfbc2573c29e3c49a4ed8689b6daccb19471b.tar.gz
chromium_src-34ebfbc2573c29e3c49a4ed8689b6daccb19471b.tar.bz2
Get 6 more layout tests passing.
It seems at some point we disabled the platform test folder entirely in order to disable some Mac specific tests and in the process disabled some Windows tests because they appear in a sub-folder of the platform folder. This change makes us pass 6 more tests from platform/win/fast/events/, tests which needed the function dispatchMessage (and a few properties) added to TestShell. I also implemented the IS_NUMPAD modifier on the Keyboard event. A good test that relies on dispatchMessage, the properties and the NumPad detection is: LayoutTests\platform\win\fast\events\keyLocation-numpad.html. Note: This folder also contains... LayoutTests/platform/win/editing/shift-page-up-down.html ... which was added to the defer list for now. Review URL: http://codereview.chromium.org/21113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webinputevent_win.cc')
-rw-r--r--webkit/glue/webinputevent_win.cc50
1 files changed, 47 insertions, 3 deletions
diff --git a/webkit/glue/webinputevent_win.cc b/webkit/glue/webinputevent_win.cc
index 9bf04e0..bcf573c 100644
--- a/webkit/glue/webinputevent_win.cc
+++ b/webkit/glue/webinputevent_win.cc
@@ -257,6 +257,50 @@ WebMouseWheelEvent::WebMouseWheelEvent(HWND hwnd, UINT message, WPARAM wparam,
// WebKeyboardEvent -----------------------------------------------------------
+bool IsKeyPad(WPARAM wparam, LPARAM lparam) {
+ bool keypad = false;
+ switch (wparam) {
+ case VK_RETURN:
+ keypad = (lparam >> 16) & KF_EXTENDED;
+ break;
+ case VK_INSERT:
+ case VK_DELETE:
+ case VK_HOME:
+ case VK_END:
+ case VK_PRIOR:
+ case VK_NEXT:
+ case VK_UP:
+ case VK_DOWN:
+ case VK_LEFT:
+ case VK_RIGHT:
+ keypad = !((lparam >> 16) & KF_EXTENDED);
+ break;
+ case VK_NUMLOCK:
+ case VK_NUMPAD0:
+ case VK_NUMPAD1:
+ case VK_NUMPAD2:
+ case VK_NUMPAD3:
+ case VK_NUMPAD4:
+ case VK_NUMPAD5:
+ case VK_NUMPAD6:
+ case VK_NUMPAD7:
+ case VK_NUMPAD8:
+ case VK_NUMPAD9:
+ case VK_DIVIDE:
+ case VK_MULTIPLY:
+ case VK_SUBTRACT:
+ case VK_ADD:
+ case VK_DECIMAL:
+ case VK_CLEAR:
+ keypad = true;
+ break;
+ default:
+ keypad = false;
+ }
+
+ return keypad;
+}
+
WebKeyboardEvent::WebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam,
LPARAM lparam) {
system_key = false;
@@ -289,7 +333,7 @@ WebKeyboardEvent::WebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam,
type = CHAR;
break;
default:
- NOTREACHED() << "unexpected native message";
+ NOTREACHED() << "unexpected native message: " << message;
}
if (GetKeyState(VK_SHIFT) & 0x8000)
@@ -301,7 +345,7 @@ WebKeyboardEvent::WebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam,
if (LOWORD(lparam) > 1)
modifiers |= IS_AUTO_REPEAT;
-
- // TODO(darin): figure out if we should set IS_KEYPAD
+ if (IsKeyPad(wparam, lparam))
+ modifiers |= IS_KEYPAD;
}