1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/events/ozone/evdev/keyboard_util_evdev.h"
7 #include <linux/input.h>
9 #include "ui/events/keycodes/dom/keycode_converter.h"
15 const int kXkbKeycodeOffset
= 8;
19 int NativeCodeToEvdevCode(int native_code
) {
20 if (native_code
== KeycodeConverter::InvalidNativeKeycode())
23 return native_code
- kXkbKeycodeOffset
;
26 int EvdevCodeToNativeCode(int evdev_code
) {
27 if (evdev_code
== KEY_RESERVED
)
28 return KeycodeConverter::InvalidNativeKeycode();
30 return evdev_code
+ kXkbKeycodeOffset
;