OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/event.h" | 5 #include "ui/events/event.h" |
6 #include "ui/events/keycodes/dom3/dom_code.h" | 6 #include "ui/events/keycodes/dom3/dom_code.h" |
7 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" | 7 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" |
8 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" | 8 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" |
9 #include "ui/events/ozone/evdev/input_injector_evdev.h" | 9 #include "ui/events/ozone/evdev/input_injector_evdev.h" |
10 #include "ui/events/ozone/evdev/keyboard_evdev.h" | 10 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
| 11 #include "ui/events/ozone/evdev/keyboard_util_evdev.h" |
11 | 12 |
12 namespace ui { | 13 namespace ui { |
13 | 14 |
14 InputInjectorEvdev::InputInjectorEvdev(EventModifiersEvdev* modifiers, | 15 InputInjectorEvdev::InputInjectorEvdev(EventModifiersEvdev* modifiers, |
15 CursorDelegateEvdev* cursor, | 16 CursorDelegateEvdev* cursor, |
16 KeyboardEvdev* keyboard, | 17 KeyboardEvdev* keyboard, |
17 const EventDispatchCallback& callback) | 18 const EventDispatchCallback& callback) |
18 : modifiers_(modifiers), | 19 : modifiers_(modifiers), |
19 cursor_(cursor), | 20 cursor_(cursor), |
20 keyboard_(keyboard), | 21 keyboard_(keyboard), |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 0 /* changed_button_flags */))); | 76 0 /* changed_button_flags */))); |
76 } | 77 } |
77 } | 78 } |
78 | 79 |
79 void InputInjectorEvdev::InjectKeyPress(DomCode physical_key, bool down) { | 80 void InputInjectorEvdev::InjectKeyPress(DomCode physical_key, bool down) { |
80 if (physical_key == DomCode::NONE) { | 81 if (physical_key == DomCode::NONE) { |
81 return; | 82 return; |
82 } | 83 } |
83 | 84 |
84 int native_keycode = KeycodeConverter::DomCodeToNativeKeycode(physical_key); | 85 int native_keycode = KeycodeConverter::DomCodeToNativeKeycode(physical_key); |
85 int evdev_code = KeyboardEvdev::NativeCodeToEvdevCode(native_keycode); | 86 int evdev_code = NativeCodeToEvdevCode(native_keycode); |
86 keyboard_->OnKeyChange(evdev_code, down); | 87 keyboard_->OnKeyChange(evdev_code, down); |
87 } | 88 } |
88 | 89 |
89 } // namespace ui | 90 } // namespace ui |
90 | 91 |
OLD | NEW |