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

Unified Diff: Source/web/WebInputEventConversion.cpp

Issue 1352283002: Remove PlatformKeyboardEvents requirement to have located virtual keycode information. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/web/WebInputEvent.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebInputEventConversion.cpp
diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp
index 025a8ac2b21fff7bebf859fca93e7e066279c004..6083b1e06df1648808cb2e5877611b1019e7f5a9 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -109,6 +109,10 @@ static unsigned toPlatformKeyboardEventModifiers(int webModifiers)
newModifiers |= PlatformEvent::IsKeyPad;
if (webModifiers & WebInputEvent::IsAutoRepeat)
newModifiers |= PlatformEvent::IsAutoRepeat;
+ if (webModifiers & WebInputEvent::IsLeft)
+ newModifiers |= PlatformEvent::IsLeft;
+ if (webModifiers & WebInputEvent::IsRight)
+ newModifiers |= PlatformEvent::IsRight;
return newModifiers;
}
@@ -326,28 +330,7 @@ PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder(const WebKeyboardEven
m_key = Platform::current()->domKeyStringFromEnum(e.domKey);
m_modifiers = toPlatformKeyboardEventModifiers(e.modifiers);
-
- // FIXME: PlatformKeyboardEvents expect a locational version of the keycode (e.g. VK_LSHIFT
- // instead of VK_SHIFT). This should be changed so the location/keycode are stored separately,
- // as in other places in the code.
m_windowsVirtualKeyCode = e.windowsKeyCode;
- if (e.windowsKeyCode == VK_SHIFT) {
- if (e.modifiers & WebInputEvent::IsLeft)
- m_windowsVirtualKeyCode = VK_LSHIFT;
- else if (e.modifiers & WebInputEvent::IsRight)
- m_windowsVirtualKeyCode = VK_RSHIFT;
- } else if (e.windowsKeyCode == VK_CONTROL) {
- if (e.modifiers & WebInputEvent::IsLeft)
- m_windowsVirtualKeyCode = VK_LCONTROL;
- else if (e.modifiers & WebInputEvent::IsRight)
- m_windowsVirtualKeyCode = VK_RCONTROL;
- } else if (e.windowsKeyCode == VK_MENU) {
- if (e.modifiers & WebInputEvent::IsLeft)
- m_windowsVirtualKeyCode = VK_LMENU;
- else if (e.modifiers & WebInputEvent::IsRight)
- m_windowsVirtualKeyCode = VK_RMENU;
- }
-
}
void PlatformKeyboardEventBuilder::setKeyType(Type type)
« no previous file with comments | « Source/web/WebInputEvent.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698