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/ozone/evdev/keyboard_evdev.h" | 5 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
6 | 6 |
7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
8 #include "ui/events/event_constants.h" | 8 #include "ui/events/event_constants.h" |
9 #include "ui/events/keycodes/dom4/keycode_converter.h" | 9 #include "ui/events/keycodes/dom4/keycode_converter.h" |
10 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" | 10 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 // static | 184 // static |
185 int KeyboardEvdev::NativeCodeToEvdevCode(int native_code) { | 185 int KeyboardEvdev::NativeCodeToEvdevCode(int native_code) { |
186 if (native_code == KeycodeConverter::InvalidNativeKeycode()) { | 186 if (native_code == KeycodeConverter::InvalidNativeKeycode()) { |
187 return KEY_RESERVED; | 187 return KEY_RESERVED; |
188 } | 188 } |
189 return native_code - kXkbKeycodeOffset; | 189 return native_code - kXkbKeycodeOffset; |
190 } | 190 } |
191 | 191 |
| 192 // static |
| 193 int KeyboardEvdev::EvdevCodeToNativeCode(int evdev_code) { |
| 194 if (evdev_code == KEY_RESERVED) |
| 195 return KeycodeConverter::InvalidNativeKeycode(); |
| 196 return evdev_code + kXkbKeycodeOffset; |
| 197 } |
| 198 |
192 } // namespace ui | 199 } // namespace ui |
OLD | NEW |