summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 20:17:53 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 20:17:53 +0000
commit1ab57f0ac1e3355f27484002c7b73fbe62cbb91a (patch)
tree5c3a92651348b1e72fb44d7d522717360455336a /webkit
parentfe6f29f04e4d87da894e32f056b852e03403696e (diff)
downloadchromium_src-1ab57f0ac1e3355f27484002c7b73fbe62cbb91a.zip
chromium_src-1ab57f0ac1e3355f27484002c7b73fbe62cbb91a.tar.gz
chromium_src-1ab57f0ac1e3355f27484002c7b73fbe62cbb91a.tar.bz2
Clean up the EventExecutor implementations.
* Cope better with malformed input. * Make logging more uniform across platforms. * Make the implementations more consistent looking. BUG=118513 TEST=Manually verify that input events behave as expected. Review URL: http://codereview.chromium.org/9968108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/usb_keycode_map.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/usb_keycode_map.h b/webkit/plugins/ppapi/usb_keycode_map.h
index 8cfb803..0f98b86 100644
--- a/webkit/plugins/ppapi/usb_keycode_map.h
+++ b/webkit/plugins/ppapi/usb_keycode_map.h
@@ -6,7 +6,7 @@
// src/remoting/host/usb_keycode_map.h
// src/webkit/plugins/ppapi/usb_keycode_map.h
// Changes to this file must be made in both locations.
-// TODO(garykac): Move file into shared location.
+// TODO(wez): Move file into shared location (crbug.com/122174).
// Data in this file was created by referencing:
// USB HID Usage Tables (v1.11) 27 June 2001
@@ -379,3 +379,13 @@ const usb_keymap usb_keycode_map[] = {
USB_KEYMAP(0x0c028b, 0x00f1, 0x0000, 0xffff), // AC_ForwardMsg (MailForward)
USB_KEYMAP(0x0c028c, 0x00ef, 0x0000, 0xffff), // AC_Send
};
+
+const uint16_t kInvalidKeycode = usb_keycode_map[0].native_keycode;
+
+static uint16 UsbKeycodeToNativeKeycode(uint32_t usb_keycode) {
+ for (size_t i = 0; i < arraysize(usb_keycode_map); ++i) {
+ if (usb_keycode_map[i].usb_keycode == usb_keycode)
+ return usb_keycode_map[i].native_keycode;
+ }
+ return kInvalidKeycode;
+}