diff options
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/DEPS | 1 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_input_handler.cc | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/remoting/client/DEPS b/remoting/client/DEPS index 235d972..3dc689a 100644 --- a/remoting/client/DEPS +++ b/remoting/client/DEPS @@ -2,6 +2,7 @@ include_rules = [ "+ppapi", "+jingle/glue", "+net", + "+ui/events/keycodes/dom4", "+remoting/codec", "+remoting/protocol", diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc index 10166b8..d4b6f60 100644 --- a/remoting/client/plugin/pepper_input_handler.cc +++ b/remoting/client/plugin/pepper_input_handler.cc @@ -11,7 +11,9 @@ #include "ppapi/cpp/module_impl.h" #include "ppapi/cpp/mouse_cursor.h" #include "ppapi/cpp/point.h" +#include "ppapi/cpp/var.h" #include "remoting/proto/event.pb.h" +#include "ui/events/keycodes/dom4/keycode_converter.h" namespace remoting { @@ -41,7 +43,16 @@ uint32_t GetUsbKeyCode(pp::KeyboardInputEvent pp_key_event) { PPB_KEYBOARD_INPUT_EVENT_DEV_INTERFACE)); if (!key_event_interface) return 0; - return key_event_interface->GetUsbKeyCode(pp_key_event.pp_resource()); + + // Get the DOM3 |code| as a string. + pp::Var codevar(key_event_interface->GetCode(pp_key_event.pp_resource())); + if (!codevar.is_string()) + return 0; + std::string codestr = codevar.AsString(); + + // Convert the |code| string into a USB keycode. + ui::KeycodeConverter* key_converter = ui::KeycodeConverter::GetInstance(); + return key_converter->CodeToUsbKeycode(codestr.c_str()); } bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) { |