diff options
| author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
| commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
| tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebKit/chromium/src/win | |
| parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
| download | external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2 | |
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'WebKit/chromium/src/win')
| -rw-r--r-- | WebKit/chromium/src/win/WebInputEventFactory.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/WebKit/chromium/src/win/WebInputEventFactory.cpp b/WebKit/chromium/src/win/WebInputEventFactory.cpp index d1d5869..c71a3b6 100644 --- a/WebKit/chromium/src/win/WebInputEventFactory.cpp +++ b/WebKit/chromium/src/win/WebInputEventFactory.cpp @@ -86,6 +86,16 @@ static bool isKeyPad(WPARAM wparam, LPARAM lparam) return keypad; } +// Loads the state for toggle keys into the event. +static void SetToggleKeyState(WebInputEvent* event) +{ + // Low bit set from GetKeyState indicates "toggled". + if (::GetKeyState(VK_NUMLOCK) & 1) + event->modifiers |= WebInputEvent::NumLockOn; + if (::GetKeyState(VK_CAPITAL) & 1) + event->modifiers |= WebInputEvent::CapsLockOn; +} + WebKeyboardEvent WebInputEventFactory::keyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { @@ -144,6 +154,7 @@ WebKeyboardEvent WebInputEventFactory::keyboardEvent(HWND hwnd, UINT message, if (isKeyPad(wparam, lparam)) result.modifiers |= WebInputEvent::IsKeyPad; + SetToggleKeyState(&result); return result; } @@ -289,6 +300,7 @@ WebMouseEvent WebInputEventFactory::mouseEvent(HWND hwnd, UINT message, if (wparam & MK_RBUTTON) result.modifiers |= WebInputEvent::RightButtonDown; + SetToggleKeyState(&result); return result; } @@ -386,6 +398,8 @@ WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(HWND hwnd, UINT message if (keyState & MK_RBUTTON) result.modifiers |= WebInputEvent::RightButtonDown; + SetToggleKeyState(&result); + // Set coordinates by translating event coordinates from screen to client. POINT clientPoint = { result.globalX, result.globalY }; MapWindowPoints(0, hwnd, &clientPoint, 1); |
