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

Unified Diff: webkit/plugins/ppapi/usb_key_code_conversion_win.cc

Issue 12320014: Switch Pepper Linux to use shared USB<->native key conversion table. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missed kInvalidKeycode. Created 7 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/plugins/ppapi/usb_key_code_conversion_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/usb_key_code_conversion_win.cc
diff --git a/webkit/plugins/ppapi/usb_key_code_conversion_win.cc b/webkit/plugins/ppapi/usb_key_code_conversion_win.cc
index 93bdfef3a87bee8a143bfd228579ad3d6b72be20..c497f1504ec7c5371c592b08d7760427f4034961 100644
--- a/webkit/plugins/ppapi/usb_key_code_conversion_win.cc
+++ b/webkit/plugins/ppapi/usb_key_code_conversion_win.cc
@@ -20,19 +20,13 @@ namespace {
} // anonymous namespace
-
uint32_t UsbKeyCodeForKeyboardEvent(const WebKeyboardEvent& key_event) {
// Extract the scancode and extended bit from the native key event's lParam.
int scancode = (key_event.nativeKeyCode >> 16) & 0x000000FF;
if ((key_event.nativeKeyCode & (1 << 24)) != 0)
scancode |= 0xe000;
- for (int i = 0; i < arraysize(usb_keycode_map); i++) {
- if (usb_keycode_map[i].native_keycode == scancode)
- return usb_keycode_map[i].usb_keycode;
- }
-
- return 0;
+ return NativeKeycodeToUsbKeycode(scancode);
}
} // namespace ppapi
« no previous file with comments | « webkit/plugins/ppapi/usb_key_code_conversion_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698