| Index: mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| diff --git a/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc b/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| index d7ae1f03ff456b8c419fbd67f9278b92b0f85281..f0a6a6ae364b3452f70faecca92ee3f05477239a 100644
|
| --- a/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| +++ b/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| @@ -4,6 +4,11 @@
|
|
|
| #include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
|
|
|
| +#if defined(USE_X11)
|
| +#include <X11/extensions/XInput2.h>
|
| +#include <X11/Xlib.h>
|
| +#endif
|
| +
|
| #include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
|
| #include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
|
| #include "ui/events/event_utils.h"
|
| @@ -125,6 +130,13 @@ EventPtr TypeConverter<EventPtr, ui::Event>::ConvertFrom(
|
| KeyDataPtr key_data(KeyData::New());
|
| key_data->key_code = key_event->key_code();
|
| key_data->is_char = key_event->is_char();
|
| +
|
| + key_data->windows_key_code =
|
| + static_cast<mojo::KeyboardCode>(key_event->GetWindowsKeyCode());
|
| + key_data->native_key_code = key_event->platform_keycode();
|
| + key_data->text = key_event->GetKeyText();
|
| + key_data->unmodified_text = key_event->GetKeyUnmodifiedText();
|
| +
|
| event->key_data = key_data.Pass();
|
| } else if (input.IsMouseWheelEvent()) {
|
| const ui::MouseWheelEvent* wheel_event =
|
| @@ -160,21 +172,29 @@ TypeConverter<EventPtr, scoped_ptr<ui::Event> >::ConvertTo(
|
|
|
| switch (input->action) {
|
| case ui::ET_KEY_PRESSED:
|
| - case ui::ET_KEY_RELEASED:
|
| + case ui::ET_KEY_RELEASED: {
|
| + scoped_ptr<ui::KeyEvent> key_event;
|
| if (input->key_data->is_char) {
|
| - ui_event.reset(new ui::KeyEvent(
|
| + key_event.reset(new ui::KeyEvent(
|
| static_cast<base::char16>(input->key_data->key_code),
|
| static_cast<ui::KeyboardCode>(
|
| input->key_data->key_code),
|
| input->flags));
|
| } else {
|
| - ui_event.reset(new ui::KeyEvent(
|
| + key_event.reset(new ui::KeyEvent(
|
| ui_event_type,
|
| static_cast<ui::KeyboardCode>(
|
| input->key_data->key_code),
|
| input->flags));
|
| }
|
| + key_event->SetSelfContainedKeyEventData(
|
| + static_cast<int32_t>(input->key_data->windows_key_code),
|
| + input->key_data->native_key_code,
|
| + input->key_data->text,
|
| + input->key_data->unmodified_text);
|
| + ui_event = key_event.PassAs<ui::KeyEvent>();
|
| break;
|
| + }
|
| case EVENT_TYPE_MOUSE_PRESSED:
|
| case EVENT_TYPE_MOUSE_DRAGGED:
|
| case EVENT_TYPE_MOUSE_RELEASED:
|
|
|