summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebInputEvent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/src/WebInputEvent.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebInputEvent.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/src/WebInputEvent.cpp b/Source/WebKit/chromium/src/WebInputEvent.cpp
index d61eb2d31..96123c62e 100644
--- a/Source/WebKit/chromium/src/WebInputEvent.cpp
+++ b/Source/WebKit/chromium/src/WebInputEvent.cpp
@@ -202,4 +202,41 @@ void WebKeyboardEvent::setKeyIdentifierFromWindowsKeyCode()
snprintf(keyIdentifier, sizeof(keyIdentifier), "U+%04X", toupper(windowsKeyCode));
}
+// static
+int WebKeyboardEvent::windowsKeyCodeWithoutLocation(int keycode)
+{
+ switch (keycode) {
+ case VK_LCONTROL:
+ case VK_RCONTROL:
+ return VK_CONTROL;
+ case VK_LSHIFT:
+ case VK_RSHIFT:
+ return VK_SHIFT;
+ case VK_LMENU:
+ case VK_RMENU:
+ return VK_MENU;
+ default:
+ return keycode;
+ }
+}
+
+// static
+int WebKeyboardEvent::locationModifiersFromWindowsKeyCode(int keycode)
+{
+ switch (keycode) {
+ case VK_LCONTROL:
+ case VK_LSHIFT:
+ case VK_LMENU:
+ case VK_LWIN:
+ return IsLeft;
+ case VK_RCONTROL:
+ case VK_RSHIFT:
+ case VK_RMENU:
+ case VK_RWIN:
+ return IsRight;
+ default:
+ return 0;
+ }
+}
+
} // namespace WebKit