Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Side by Side Diff: ui/events/ozone/evdev/keyboard_util_evdev.cc

Issue 872883003: [PATCH 2/11] ozone: evdev: Move KeyboardEvdev usage during dispatch to EventFactoryEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates for events_unittests Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "ui/events/ozone/evdev/keyboard_util_evdev.h"
6
7 #include <linux/input.h>
8
9 #include "ui/events/keycodes/dom4/keycode_converter.h"
10
11 namespace ui {
12
13 namespace {
14
15 const int kXkbKeycodeOffset = 8;
16
17 } // namespace
18
19 int NativeCodeToEvdevCode(int native_code) {
20 if (native_code == KeycodeConverter::InvalidNativeKeycode())
21 return KEY_RESERVED;
22
23 return native_code - kXkbKeycodeOffset;
24 }
25
26 int EvdevCodeToNativeCode(int evdev_code) {
27 if (evdev_code == KEY_RESERVED)
28 return KeycodeConverter::InvalidNativeKeycode();
29
30 return evdev_code + kXkbKeycodeOffset;
31 }
32
33 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698