summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 14:29:04 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 14:29:04 +0000
commit44cd30458dcf9f7b2fc2014faed9d9cfdb0432ac (patch)
treec19bd2c1fcdd787a752b56aa098fd551cec23aed /webkit
parent1c1a5eb20b6138a23e4000b19f1ed2ba16893148 (diff)
downloadchromium_src-44cd30458dcf9f7b2fc2014faed9d9cfdb0432ac.zip
chromium_src-44cd30458dcf9f7b2fc2014faed9d9cfdb0432ac.tar.gz
chromium_src-44cd30458dcf9f7b2fc2014faed9d9cfdb0432ac.tar.bz2
[Chromoting] Add USB keycode handling to Windows client.
Update code that converts from native Windows scancodes into USB keycodes. The code now uses a table that is shared across platforms. Pepper uses this table when populating the |usb_key_code| field in the InputEvent. This cl also bring the webkit/plugins/ppapi/usb_keycode_map.h file in sync with the one in remoting/host. Review URL: https://chromiumcodereview.appspot.com/9619014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webkit_glue.gypi1
-rw-r--r--webkit/plugins/ppapi/usb_key_code_conversion.cc3
-rw-r--r--webkit/plugins/ppapi/usb_key_code_conversion_win.cc39
-rw-r--r--webkit/plugins/ppapi/usb_keycode_map.h278
4 files changed, 182 insertions, 139 deletions
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi
index 4a12966..a5a3743 100644
--- a/webkit/glue/webkit_glue.gypi
+++ b/webkit/glue/webkit_glue.gypi
@@ -345,6 +345,7 @@
'../plugins/ppapi/usb_key_code_conversion.cc',
'../plugins/ppapi/usb_key_code_conversion_linux.cc',
'../plugins/ppapi/usb_key_code_conversion_mac.cc',
+ '../plugins/ppapi/usb_key_code_conversion_win.cc',
'../plugins/ppapi/usb_keycode_map.h',
'../plugins/sad_plugin.cc',
'../plugins/sad_plugin.h',
diff --git a/webkit/plugins/ppapi/usb_key_code_conversion.cc b/webkit/plugins/ppapi/usb_key_code_conversion.cc
index ab76fab..b63e5c6 100644
--- a/webkit/plugins/ppapi/usb_key_code_conversion.cc
+++ b/webkit/plugins/ppapi/usb_key_code_conversion.cc
@@ -11,8 +11,7 @@ using WebKit::WebKeyboardEvent;
namespace webkit {
namespace ppapi {
-// TODO(garykac): Implement for Windows.
-#if !defined(OS_LINUX) && !defined(OS_MACOSX)
+#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_WIN)
uint32_t UsbKeyCodeForKeyboardEvent(const WebKeyboardEvent& key_event) {
return 0;
diff --git a/webkit/plugins/ppapi/usb_key_code_conversion_win.cc b/webkit/plugins/ppapi/usb_key_code_conversion_win.cc
new file mode 100644
index 0000000..decdc58
--- /dev/null
+++ b/webkit/plugins/ppapi/usb_key_code_conversion_win.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/plugins/ppapi/usb_key_code_conversion.h"
+
+#include "base/basictypes.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
+
+using WebKit::WebKeyboardEvent;
+
+namespace webkit {
+namespace ppapi {
+
+namespace {
+
+#define USB_KEYMAP(usb, xkb, win, mac) {usb, win}
+#include "webkit/plugins/ppapi/usb_keycode_map.h"
+#undef USB_KEYMAP
+
+} // 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;
+}
+
+} // namespace ppapi
+} // namespace webkit
diff --git a/webkit/plugins/ppapi/usb_keycode_map.h b/webkit/plugins/ppapi/usb_keycode_map.h
index 1bab95c..1c046d3 100644
--- a/webkit/plugins/ppapi/usb_keycode_map.h
+++ b/webkit/plugins/ppapi/usb_keycode_map.h
@@ -27,6 +27,9 @@ typedef struct {
const usb_keymap usb_keycode_map[] = {
+ // USB XKB Win Mac
+ USB_KEYMAP(0x000000, 0x0000, 0x0000, 0xffff), // Invalid
+
// =========================================
// USB Usage Page 0x01: Generic Desktop Page
// =========================================
@@ -57,154 +60,155 @@ const usb_keymap usb_keycode_map[] = {
USB_KEYMAP(0x070001, 0x0000, 0x0000, 0xffff), // ErrorRollOver
USB_KEYMAP(0x070002, 0x0000, 0x0000, 0xffff), // POSTFail
USB_KEYMAP(0x070003, 0x0000, 0x0000, 0xffff), // ErrorUndefined
- USB_KEYMAP(0x070004, 0x0026, 0x0000, 0x0000), // aA
- USB_KEYMAP(0x070005, 0x0038, 0x0000, 0x000b), // bB
- USB_KEYMAP(0x070006, 0x0036, 0x0000, 0x0008), // cC
- USB_KEYMAP(0x070007, 0x0028, 0x0000, 0x0002), // dD
-
- USB_KEYMAP(0x070008, 0x001a, 0x0000, 0x000e), // eE
- USB_KEYMAP(0x070009, 0x0029, 0x0000, 0x0003), // fF
- USB_KEYMAP(0x07000a, 0x002a, 0x0000, 0x0005), // gG
- USB_KEYMAP(0x07000b, 0x002b, 0x0000, 0x0004), // hH
- USB_KEYMAP(0x07000c, 0x001f, 0x0000, 0x0022), // iI
- USB_KEYMAP(0x07000d, 0x002c, 0x0000, 0x0026), // jJ
- USB_KEYMAP(0x07000e, 0x002d, 0x0000, 0x0028), // kK
- USB_KEYMAP(0x07000f, 0x002e, 0x0000, 0x0025), // lL
-
- USB_KEYMAP(0x070010, 0x003a, 0x0000, 0x002e), // mM
- USB_KEYMAP(0x070011, 0x0039, 0x0000, 0x002d), // nN
- USB_KEYMAP(0x070012, 0x0020, 0x0000, 0x001f), // oO
- USB_KEYMAP(0x070013, 0x0021, 0x0000, 0x0023), // pP
- USB_KEYMAP(0x070014, 0x0018, 0x0000, 0x000c), // qQ
- USB_KEYMAP(0x070015, 0x001b, 0x0000, 0x000f), // rR
- USB_KEYMAP(0x070016, 0x0027, 0x0000, 0x0001), // sS
- USB_KEYMAP(0x070017, 0x001c, 0x0000, 0x0011), // tT
-
- USB_KEYMAP(0x070018, 0x001e, 0x0000, 0x0020), // uU
- USB_KEYMAP(0x070019, 0x0037, 0x0000, 0x0009), // vV
- USB_KEYMAP(0x07001a, 0x0019, 0x0000, 0x000d), // wW
- USB_KEYMAP(0x07001b, 0x0035, 0x0000, 0x0007), // xX
- USB_KEYMAP(0x07001c, 0x001d, 0x0000, 0x0010), // yY
- USB_KEYMAP(0x07001d, 0x0034, 0x0000, 0x0006), // zZ
- USB_KEYMAP(0x07001e, 0x000a, 0x0000, 0x0012), // 1!
- USB_KEYMAP(0x07001f, 0x000b, 0x0000, 0x0013), // 2@
-
- USB_KEYMAP(0x070020, 0x000c, 0x0000, 0x0014), // 3#
- USB_KEYMAP(0x070021, 0x000d, 0x0000, 0x0015), // 4$
- USB_KEYMAP(0x070022, 0x000e, 0x0000, 0x0017), // 5%
- USB_KEYMAP(0x070023, 0x000f, 0x0000, 0x0016), // 6^
- USB_KEYMAP(0x070024, 0x0010, 0x0000, 0x001a), // 7&
- USB_KEYMAP(0x070025, 0x0011, 0x0000, 0x001c), // 8*
- USB_KEYMAP(0x070026, 0x0012, 0x0000, 0x0019), // 9(
- USB_KEYMAP(0x070027, 0x0013, 0x0000, 0x001d), // 0)
-
- USB_KEYMAP(0x070028, 0x0024, 0x0000, 0x0024), // Return
- USB_KEYMAP(0x070029, 0x0009, 0x0000, 0x0035), // Escape
- USB_KEYMAP(0x07002a, 0x0016, 0x0000, 0x0033), // Backspace
- USB_KEYMAP(0x07002b, 0x0017, 0x0000, 0x0030), // Tab
- USB_KEYMAP(0x07002c, 0x0041, 0x0000, 0x0031), // Spacebar
- USB_KEYMAP(0x07002d, 0x0014, 0x0000, 0x001b), // -_
- USB_KEYMAP(0x07002e, 0x0015, 0x0000, 0x0018), // =+
- USB_KEYMAP(0x07002f, 0x0022, 0x0000, 0x0021), // [{
-
- USB_KEYMAP(0x070030, 0x0023, 0x0000, 0x001e), // }]
- USB_KEYMAP(0x070031, 0x0033, 0x0000, 0x002a), // \| (US keyboard only)
+ USB_KEYMAP(0x070004, 0x0026, 0x001e, 0x0000), // aA
+ USB_KEYMAP(0x070005, 0x0038, 0x0030, 0x000b), // bB
+ USB_KEYMAP(0x070006, 0x0036, 0x002e, 0x0008), // cC
+ USB_KEYMAP(0x070007, 0x0028, 0x0020, 0x0002), // dD
+
+ USB_KEYMAP(0x070008, 0x001a, 0x0012, 0x000e), // eE
+ USB_KEYMAP(0x070009, 0x0029, 0x0021, 0x0003), // fF
+ USB_KEYMAP(0x07000a, 0x002a, 0x0022, 0x0005), // gG
+ USB_KEYMAP(0x07000b, 0x002b, 0x0023, 0x0004), // hH
+ USB_KEYMAP(0x07000c, 0x001f, 0x0017, 0x0022), // iI
+ USB_KEYMAP(0x07000d, 0x002c, 0x0024, 0x0026), // jJ
+ USB_KEYMAP(0x07000e, 0x002d, 0x0025, 0x0028), // kK
+ USB_KEYMAP(0x07000f, 0x002e, 0x0026, 0x0025), // lL
+
+ USB_KEYMAP(0x070010, 0x003a, 0x0032, 0x002e), // mM
+ USB_KEYMAP(0x070011, 0x0039, 0x0031, 0x002d), // nN
+ USB_KEYMAP(0x070012, 0x0020, 0x0018, 0x001f), // oO
+ USB_KEYMAP(0x070013, 0x0021, 0x0019, 0x0023), // pP
+ USB_KEYMAP(0x070014, 0x0018, 0x0010, 0x000c), // qQ
+ USB_KEYMAP(0x070015, 0x001b, 0x0013, 0x000f), // rR
+ USB_KEYMAP(0x070016, 0x0027, 0x001f, 0x0001), // sS
+ USB_KEYMAP(0x070017, 0x001c, 0x0014, 0x0011), // tT
+
+ USB_KEYMAP(0x070018, 0x001e, 0x0016, 0x0020), // uU
+ USB_KEYMAP(0x070019, 0x0037, 0x002f, 0x0009), // vV
+ USB_KEYMAP(0x07001a, 0x0019, 0x0011, 0x000d), // wW
+ USB_KEYMAP(0x07001b, 0x0035, 0x002d, 0x0007), // xX
+ USB_KEYMAP(0x07001c, 0x001d, 0x0015, 0x0010), // yY
+ USB_KEYMAP(0x07001d, 0x0034, 0x002c, 0x0006), // zZ
+ USB_KEYMAP(0x07001e, 0x000a, 0x0002, 0x0012), // 1!
+ USB_KEYMAP(0x07001f, 0x000b, 0x0003, 0x0013), // 2@
+
+ USB_KEYMAP(0x070020, 0x000c, 0x0004, 0x0014), // 3#
+ USB_KEYMAP(0x070021, 0x000d, 0x0005, 0x0015), // 4$
+ USB_KEYMAP(0x070022, 0x000e, 0x0006, 0x0017), // 5%
+ USB_KEYMAP(0x070023, 0x000f, 0x0007, 0x0016), // 6^
+ USB_KEYMAP(0x070024, 0x0010, 0x0008, 0x001a), // 7&
+ USB_KEYMAP(0x070025, 0x0011, 0x0009, 0x001c), // 8*
+ USB_KEYMAP(0x070026, 0x0012, 0x000a, 0x0019), // 9(
+ USB_KEYMAP(0x070027, 0x0013, 0x000b, 0x001d), // 0)
+
+ USB_KEYMAP(0x070028, 0x0024, 0x001c, 0x0024), // Return
+ USB_KEYMAP(0x070029, 0x0009, 0x0001, 0x0035), // Escape
+ USB_KEYMAP(0x07002a, 0x0016, 0x000e, 0x0033), // Backspace
+ USB_KEYMAP(0x07002b, 0x0017, 0x000f, 0x0030), // Tab
+ USB_KEYMAP(0x07002c, 0x0041, 0x0039, 0x0031), // Spacebar
+ USB_KEYMAP(0x07002d, 0x0014, 0x000c, 0x001b), // -_
+ USB_KEYMAP(0x07002e, 0x0015, 0x000d, 0x0018), // =+
+ USB_KEYMAP(0x07002f, 0x0022, 0x001a, 0x0021), // [{
+
+ USB_KEYMAP(0x070030, 0x0023, 0x001b, 0x001e), // }]
+ USB_KEYMAP(0x070031, 0x0033, 0x002b, 0x002a), // \| (US keyboard only)
// USB#070032 is not present on US keyboard.
// The keycap varies on international keyboards:
// Dan: '* Dutch: <> Ger: #' UK: #~
// For XKB, it uses the same scancode as the US \| key.
// TODO(garykac): Verify Mac intl keyboard.
- USB_KEYMAP(0x070032, 0x0033, 0x0000, 0x002a), // #~ (Non-US)
- USB_KEYMAP(0x070033, 0x002f, 0x0000, 0x0029), // ;:
- USB_KEYMAP(0x070034, 0x0030, 0x0000, 0x0027), // '"
- USB_KEYMAP(0x070035, 0x0031, 0x0000, 0x0032), // `~
- USB_KEYMAP(0x070036, 0x003b, 0x0000, 0x002b), // ,<
- USB_KEYMAP(0x070037, 0x003c, 0x0000, 0x002f), // .>
-
- USB_KEYMAP(0x070038, 0x003d, 0x0000, 0x002c), // /?
- USB_KEYMAP(0x070039, 0x0042, 0x0000, 0x0039), // CapsLock
- USB_KEYMAP(0x07003a, 0x0043, 0x0000, 0x007a), // F1
- USB_KEYMAP(0x07003b, 0x0044, 0x0000, 0x0078), // F2
- USB_KEYMAP(0x07003c, 0x0045, 0x0000, 0x0063), // F3
- USB_KEYMAP(0x07003d, 0x0046, 0x0000, 0x0076), // F4
- USB_KEYMAP(0x07003e, 0x0047, 0x0000, 0x0060), // F5
- USB_KEYMAP(0x07003f, 0x0048, 0x0000, 0x0061), // F6
-
- USB_KEYMAP(0x070040, 0x0049, 0x0000, 0x0062), // F7
- USB_KEYMAP(0x070041, 0x004a, 0x0000, 0x0064), // F8
- USB_KEYMAP(0x070042, 0x004b, 0x0000, 0x0065), // F9
- USB_KEYMAP(0x070043, 0x004c, 0x0000, 0x006d), // F10
- USB_KEYMAP(0x070044, 0x005f, 0x0000, 0x0067), // F11
- USB_KEYMAP(0x070045, 0x0060, 0x0000, 0x006f), // F12
- USB_KEYMAP(0x070046, 0x006b, 0x0000, 0xffff), // PrintScreen
- USB_KEYMAP(0x070047, 0x004e, 0x0000, 0xffff), // ScrollLock
+ USB_KEYMAP(0x070032, 0x0033, 0x002b, 0x002a), // #~ (Non-US)
+ USB_KEYMAP(0x070033, 0x002f, 0x0027, 0x0029), // ;:
+ USB_KEYMAP(0x070034, 0x0030, 0x0028, 0x0027), // '"
+ USB_KEYMAP(0x070035, 0x0031, 0x0029, 0x0032), // `~
+ USB_KEYMAP(0x070036, 0x003b, 0x0033, 0x002b), // ,<
+ USB_KEYMAP(0x070037, 0x003c, 0x0034, 0x002f), // .>
+
+ USB_KEYMAP(0x070038, 0x003d, 0x0035, 0x002c), // /?
+ // TODO(garykac): CapsLock requires special handling for each platform.
+ USB_KEYMAP(0x070039, 0x0042, 0x003a, 0x0039), // CapsLock
+ USB_KEYMAP(0x07003a, 0x0043, 0x003b, 0x007a), // F1
+ USB_KEYMAP(0x07003b, 0x0044, 0x003c, 0x0078), // F2
+ USB_KEYMAP(0x07003c, 0x0045, 0x003d, 0x0063), // F3
+ USB_KEYMAP(0x07003d, 0x0046, 0x003e, 0x0076), // F4
+ USB_KEYMAP(0x07003e, 0x0047, 0x003f, 0x0060), // F5
+ USB_KEYMAP(0x07003f, 0x0048, 0x0040, 0x0061), // F6
+
+ USB_KEYMAP(0x070040, 0x0049, 0x0041, 0x0062), // F7
+ USB_KEYMAP(0x070041, 0x004a, 0x0042, 0x0064), // F8
+ USB_KEYMAP(0x070042, 0x004b, 0x0043, 0x0065), // F9
+ USB_KEYMAP(0x070043, 0x004c, 0x0044, 0x006d), // F10
+ USB_KEYMAP(0x070044, 0x005f, 0x0057, 0x0067), // F11
+ USB_KEYMAP(0x070045, 0x0060, 0x0058, 0x006f), // F12
+ USB_KEYMAP(0x070046, 0x006b, 0xe037, 0xffff), // PrintScreen
+ USB_KEYMAP(0x070047, 0x004e, 0x0046, 0xffff), // ScrollLock
USB_KEYMAP(0x070048, 0x007f, 0x0000, 0xffff), // Pause
// Labeled "Help/Insert" on Mac.
- USB_KEYMAP(0x070049, 0x0076, 0x0000, 0x0072), // Insert
- USB_KEYMAP(0x07004a, 0x006e, 0x0000, 0x0073), // Home
- USB_KEYMAP(0x07004b, 0x0070, 0x0000, 0x0074), // PageUp
- USB_KEYMAP(0x07004c, 0x0077, 0x0000, 0x0075), // Delete (Forward Delete)
- USB_KEYMAP(0x07004d, 0x0073, 0x0000, 0x0077), // End
- USB_KEYMAP(0x07004e, 0x0075, 0x0000, 0x0079), // PageDown
- USB_KEYMAP(0x07004f, 0x0072, 0x0000, 0x007c), // RightArrow
-
- USB_KEYMAP(0x070050, 0x0071, 0x0000, 0x007b), // LeftArrow
- USB_KEYMAP(0x070051, 0x0074, 0x0000, 0x007d), // DownArrow
- USB_KEYMAP(0x070052, 0x006f, 0x0000, 0x007e), // UpArrow
- USB_KEYMAP(0x070053, 0x004d, 0x0000, 0x0047), // Keypad_NumLock Clear
- USB_KEYMAP(0x070054, 0x006a, 0x0000, 0x004b), // Keypad_/
- USB_KEYMAP(0x070055, 0x003f, 0x0000, 0x0043), // Keypad_*
- USB_KEYMAP(0x070056, 0x0052, 0x0000, 0x004e), // Keypad_-
- USB_KEYMAP(0x070057, 0x0056, 0x0000, 0x0045), // Keypad_+
-
- USB_KEYMAP(0x070058, 0x0068, 0x0000, 0x004c), // Keypad_Enter
- USB_KEYMAP(0x070059, 0x0057, 0x0000, 0x0053), // Keypad_1 End
- USB_KEYMAP(0x07005a, 0x0058, 0x0000, 0x0054), // Keypad_2 DownArrow
- USB_KEYMAP(0x07005b, 0x0059, 0x0000, 0x0055), // Keypad_3 PageDown
- USB_KEYMAP(0x07005c, 0x0053, 0x0000, 0x0056), // Keypad_4 LeftArrow
- USB_KEYMAP(0x07005d, 0x0054, 0x0000, 0x0057), // Keypad_5
- USB_KEYMAP(0x07005e, 0x0055, 0x0000, 0x0058), // Keypad_6 RightArrow
- USB_KEYMAP(0x07005f, 0x004f, 0x0000, 0x0059), // Keypad_7 Home
-
- USB_KEYMAP(0x070060, 0x0050, 0x0000, 0x005b), // Keypad_8 UpArrow
- USB_KEYMAP(0x070061, 0x0051, 0x0000, 0x005c), // Keypad_9 PageUp
- USB_KEYMAP(0x070062, 0x005a, 0x0000, 0x0052), // Keypad_0 Insert
- USB_KEYMAP(0x070063, 0x005b, 0x0000, 0x0041), // Keypad_. Delete
+ USB_KEYMAP(0x070049, 0x0076, 0xe052, 0x0072), // Insert
+ USB_KEYMAP(0x07004a, 0x006e, 0xe047, 0x0073), // Home
+ USB_KEYMAP(0x07004b, 0x0070, 0xe04b, 0x0074), // PageUp
+ USB_KEYMAP(0x07004c, 0x0077, 0xe04c, 0x0075), // Delete (Forward Delete)
+ USB_KEYMAP(0x07004d, 0x0073, 0xe04d, 0x0077), // End
+ USB_KEYMAP(0x07004e, 0x0075, 0xe04e, 0x0079), // PageDown
+ USB_KEYMAP(0x07004f, 0x0072, 0xe04f, 0x007c), // RightArrow
+
+ USB_KEYMAP(0x070050, 0x0071, 0xe050, 0x007b), // LeftArrow
+ USB_KEYMAP(0x070051, 0x0074, 0xe051, 0x007d), // DownArrow
+ USB_KEYMAP(0x070052, 0x006f, 0xe052, 0x007e), // UpArrow
+ USB_KEYMAP(0x070053, 0x004d, 0x0045, 0x0047), // Keypad_NumLock Clear
+ USB_KEYMAP(0x070054, 0x006a, 0xe035, 0x004b), // Keypad_/
+ USB_KEYMAP(0x070055, 0x003f, 0x0037, 0x0043), // Keypad_*
+ USB_KEYMAP(0x070056, 0x0052, 0x004a, 0x004e), // Keypad_-
+ USB_KEYMAP(0x070057, 0x0056, 0x004e, 0x0045), // Keypad_+
+
+ USB_KEYMAP(0x070058, 0x0068, 0xe01c, 0x004c), // Keypad_Enter
+ USB_KEYMAP(0x070059, 0x0057, 0x004f, 0x0053), // Keypad_1 End
+ USB_KEYMAP(0x07005a, 0x0058, 0x0050, 0x0054), // Keypad_2 DownArrow
+ USB_KEYMAP(0x07005b, 0x0059, 0x0051, 0x0055), // Keypad_3 PageDown
+ USB_KEYMAP(0x07005c, 0x0053, 0x004b, 0x0056), // Keypad_4 LeftArrow
+ USB_KEYMAP(0x07005d, 0x0054, 0x004c, 0x0057), // Keypad_5
+ USB_KEYMAP(0x07005e, 0x0055, 0x004d, 0x0058), // Keypad_6 RightArrow
+ USB_KEYMAP(0x07005f, 0x004f, 0x0047, 0x0059), // Keypad_7 Home
+
+ USB_KEYMAP(0x070060, 0x0050, 0x0048, 0x005b), // Keypad_8 UpArrow
+ USB_KEYMAP(0x070061, 0x0051, 0x0049, 0x005c), // Keypad_9 PageUp
+ USB_KEYMAP(0x070062, 0x005a, 0x0052, 0x0052), // Keypad_0 Insert
+ USB_KEYMAP(0x070063, 0x005b, 0x0053, 0x0041), // Keypad_. Delete
// USB#070064 is not present on US keyboard.
// This key is typically located near LeftShift key.
// The keycap varies on international keyboards:
// Dan: <> Dutch: ][ Ger: <> UK: \|
// TODO(garykac) Determine correct XKB scancode.
- USB_KEYMAP(0x070064, 0x0000, 0x0000, 0xffff), // Non-US \|
- USB_KEYMAP(0x070065, 0x0087, 0x0000, 0xffff), // AppMenu (next to RWin key)
+ USB_KEYMAP(0x070064, 0x0000, 0x0056, 0xffff), // Non-US \|
+ USB_KEYMAP(0x070065, 0x0087, 0xe05d, 0xffff), // AppMenu (next to RWin key)
USB_KEYMAP(0x070066, 0x007c, 0x0000, 0xffff), // Power
USB_KEYMAP(0x070067, 0x007d, 0x0000, 0x0051), // Keypad_=
- USB_KEYMAP(0x070068, 0x0000, 0x0000, 0x0069), // F13
- USB_KEYMAP(0x070069, 0x0000, 0x0000, 0x006b), // F14
- USB_KEYMAP(0x07006a, 0x0000, 0x0000, 0x0071), // F15
- USB_KEYMAP(0x07006b, 0x0000, 0x0000, 0x006a), // F16
- USB_KEYMAP(0x07006c, 0x0000, 0x0000, 0x0040), // F17
- USB_KEYMAP(0x07006d, 0x0000, 0x0000, 0x004f), // F18
- USB_KEYMAP(0x07006e, 0x0000, 0x0000, 0x0050), // F19
- USB_KEYMAP(0x07006f, 0x0000, 0x0000, 0x005a), // F20
-
- USB_KEYMAP(0x070070, 0x0000, 0x0000, 0xffff), // F21
- USB_KEYMAP(0x070071, 0x0000, 0x0000, 0xffff), // F22
- USB_KEYMAP(0x070072, 0x0000, 0x0000, 0xffff), // F23
- USB_KEYMAP(0x070073, 0x0000, 0x0000, 0xffff), // F24
+ USB_KEYMAP(0x070068, 0x0000, 0x005b, 0x0069), // F13
+ USB_KEYMAP(0x070069, 0x0000, 0x005c, 0x006b), // F14
+ USB_KEYMAP(0x07006a, 0x0000, 0x005d, 0x0071), // F15
+ USB_KEYMAP(0x07006b, 0x0000, 0x0063, 0x006a), // F16
+ USB_KEYMAP(0x07006c, 0x0000, 0x0064, 0x0040), // F17
+ USB_KEYMAP(0x07006d, 0x0000, 0x0065, 0x004f), // F18
+ USB_KEYMAP(0x07006e, 0x0000, 0x0066, 0x0050), // F19
+ USB_KEYMAP(0x07006f, 0x0000, 0x0067, 0x005a), // F20
+
+ USB_KEYMAP(0x070070, 0x0000, 0x0068, 0xffff), // F21
+ USB_KEYMAP(0x070071, 0x0000, 0x0069, 0xffff), // F22
+ USB_KEYMAP(0x070072, 0x0000, 0x006a, 0xffff), // F23
+ USB_KEYMAP(0x070073, 0x0000, 0x006b, 0xffff), // F24
USB_KEYMAP(0x070074, 0x0000, 0x0000, 0xffff), // Execute
- USB_KEYMAP(0x070075, 0x0092, 0x0000, 0xffff), // Help
+ USB_KEYMAP(0x070075, 0x0092, 0xe03b, 0xffff), // Help
USB_KEYMAP(0x070076, 0x0093, 0x0000, 0xffff), // Menu
USB_KEYMAP(0x070077, 0x0000, 0x0000, 0xffff), // Select
USB_KEYMAP(0x070078, 0x0000, 0x0000, 0xffff), // Stop
USB_KEYMAP(0x070079, 0x0089, 0x0000, 0xffff), // Again (Redo)
- USB_KEYMAP(0x07007a, 0x008b, 0x0000, 0xffff), // Undo
- USB_KEYMAP(0x07007b, 0x0091, 0x0000, 0xffff), // Cut
- USB_KEYMAP(0x07007c, 0x008d, 0x0000, 0xffff), // Copy
- USB_KEYMAP(0x07007d, 0x008f, 0x0000, 0xffff), // Paste
+ USB_KEYMAP(0x07007a, 0x008b, 0xe008, 0xffff), // Undo
+ USB_KEYMAP(0x07007b, 0x0091, 0xe017, 0xffff), // Cut
+ USB_KEYMAP(0x07007c, 0x008d, 0xe018, 0xffff), // Copy
+ USB_KEYMAP(0x07007d, 0x008f, 0xe00a, 0xffff), // Paste
USB_KEYMAP(0x07007e, 0x0090, 0x0000, 0xffff), // Find
USB_KEYMAP(0x07007f, 0x0079, 0xe020, 0x004a), // Mute
@@ -315,14 +319,14 @@ const usb_keymap usb_keycode_map[] = {
//USB_KEYMAP(0x0700dd, 0x0000, 0x0000, 0xffff), // Keypad_Hexadecimal
// USB#0700de - #0700df are reserved.
- USB_KEYMAP(0x0700e0, 0x0025, 0x0000, 0x003b), // LeftControl
- USB_KEYMAP(0x0700e1, 0x0032, 0x0000, 0x0038), // LeftShift
- USB_KEYMAP(0x0700e2, 0x0040, 0x0000, 0x003a), // LeftAlt/Option
- USB_KEYMAP(0x0700e3, 0x0085, 0x0000, 0x0037), // LeftGUI/Super/Win/Cmd
- USB_KEYMAP(0x0700e4, 0x0069, 0x0000, 0x003e), // RightControl
- USB_KEYMAP(0x0700e5, 0x003e, 0x0000, 0x003c), // RightShift
- USB_KEYMAP(0x0700e6, 0x006c, 0x0000, 0x003d), // RightAlt/Option
- USB_KEYMAP(0x0700e7, 0x0086, 0x0000, 0x0036), // RightGUI/Super/Win/Cmd
+ USB_KEYMAP(0x0700e0, 0x0025, 0x001d, 0x003b), // LeftControl
+ USB_KEYMAP(0x0700e1, 0x0032, 0x002a, 0x0038), // LeftShift
+ USB_KEYMAP(0x0700e2, 0x0040, 0x0038, 0x003a), // LeftAlt/Option
+ USB_KEYMAP(0x0700e3, 0x0085, 0xe05b, 0x0037), // LeftGUI/Super/Win/Cmd
+ USB_KEYMAP(0x0700e4, 0x0069, 0xe01d, 0x003e), // RightControl
+ USB_KEYMAP(0x0700e5, 0x003e, 0x0036, 0x003c), // RightShift
+ USB_KEYMAP(0x0700e6, 0x006c, 0xe038, 0x003d), // RightAlt/Option
+ USB_KEYMAP(0x0700e7, 0x0086, 0xe05c, 0x0036), // RightGUI/Super/Win/Cmd
// USB#0700e8 - #07ffff are reserved
@@ -371,7 +375,7 @@ const usb_keymap usb_keycode_map[] = {
USB_KEYMAP(0x0c0226, 0x0000, 0xe068, 0xffff), // AC_Stop
USB_KEYMAP(0x0c0227, 0x00b5, 0xe067, 0xffff), // AC_Refresh (Reload)
USB_KEYMAP(0x0c022a, 0x00a4, 0xe066, 0xffff), // AC_Bookmarks (Favorites)
- USB_KEYMAP(0x0c0289, 0x00f0, 0xe000, 0xffff), // AC_Reply
- USB_KEYMAP(0x0c028b, 0x00f1, 0xe000, 0xffff), // AC_ForwardMsg (MailForward)
- USB_KEYMAP(0x0c028c, 0x00ef, 0xe000, 0xffff), // AC_Send
+ USB_KEYMAP(0x0c0289, 0x00f0, 0x0000, 0xffff), // AC_Reply
+ USB_KEYMAP(0x0c028b, 0x00f1, 0x0000, 0xffff), // AC_ForwardMsg (MailForward)
+ USB_KEYMAP(0x0c028c, 0x00ef, 0x0000, 0xffff), // AC_Send
};