summaryrefslogtreecommitdiffstats
path: root/remoting/host/input_injector_win.cc
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-20 15:48:28 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-20 15:48:28 +0000
commit25e58001868674fc5fc6923b9a8ea85162a18b34 (patch)
treeb6e9307752984c17c3dd387164ea1b8a9888531c /remoting/host/input_injector_win.cc
parent78e3c48db707ad3d478cfd2fcb16819e28577b4b (diff)
downloadchromium_src-25e58001868674fc5fc6923b9a8ea85162a18b34.zip
chromium_src-25e58001868674fc5fc6923b9a8ea85162a18b34.tar.gz
chromium_src-25e58001868674fc5fc6923b9a8ea85162a18b34.tar.bz2
Move usb keycode conversion table into separate target. This is the first step to making this table more accessible from other parts of the codebase.
Currently, the data table and the routines to access it are mixed in the same file, which makes it harder to reference in other places in the code. Moving it into a separate projects forces it to have a proper separation between the data and the interface and allows it to be added as a dependency without including all of ui/base. BUG=284774 R=jam@chromium.org, sky@chromium.org, wez@chromium.org Review URL: https://codereview.chromium.org/23851033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/input_injector_win.cc')
-rw-r--r--remoting/host/input_injector_win.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/remoting/host/input_injector_win.cc b/remoting/host/input_injector_win.cc
index 352f82b..121e229 100644
--- a/remoting/host/input_injector_win.cc
+++ b/remoting/host/input_injector_win.cc
@@ -17,6 +17,7 @@
// SkSize.h assumes that stdint.h-style types are already defined.
#include "third_party/skia/include/core/SkTypes.h"
#include "third_party/skia/include/core/SkSize.h"
+#include "ui/base/keycodes/keycode_converter.h"
namespace remoting {
@@ -26,11 +27,6 @@ using protocol::ClipboardEvent;
using protocol::KeyEvent;
using protocol::MouseEvent;
-// USB to XKB keycode map table.
-#define USB_KEYMAP(usb, xkb, win, mac, code) {usb, win, code}
-#include "ui/base/keycodes/usb_keycode_map.h"
-#undef USB_KEYMAP
-
// A class to generate events on Windows.
class InputInjectorWin : public InputInjector {
public:
@@ -185,13 +181,13 @@ void InputInjectorWin::Core::HandleKey(const KeyEvent& event) {
// Reset the system idle suspend timeout.
SetThreadExecutionState(ES_SYSTEM_REQUIRED);
- int scancode = UsbKeycodeToNativeKeycode(event.usb_keycode());
-
+ ui::KeycodeConverter* key_converter = ui::KeycodeConverter::GetInstance();
+ int scancode = key_converter->UsbKeycodeToNativeKeycode(event.usb_keycode());
VLOG(3) << "Converting USB keycode: " << std::hex << event.usb_keycode()
<< " to scancode: " << scancode << std::dec;
// Ignore events which can't be mapped.
- if (scancode == InvalidNativeKeycode())
+ if (scancode == key_converter->InvalidNativeKeycode())
return;
// Populate the a Windows INPUT structure for the event.