Index: components/keyboard_lock/keyboard_lock_host_x11.cc |
diff --git a/components/keyboard_lock/keyboard_lock_host_x11.cc b/components/keyboard_lock/keyboard_lock_host_x11.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..018c33ca458885048303e66bb43113f05a201201 |
--- /dev/null |
+++ b/components/keyboard_lock/keyboard_lock_host_x11.cc |
@@ -0,0 +1,20 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/keyboard_lock/keyboard_lock_host.h" |
+ |
+#include <X11/XKBlib.h> |
+ |
+#include "ui/gfx/x/x11_types.h" |
+ |
+namespace keyboard_lock { |
+ |
+// static |
+ui::KeyboardCode KeyboardLockHost::NativeKeycodeToKeyboardCode( |
+ uint32_t keycode) { |
+ return static_cast<ui::KeyboardCode>(XkbKeycodeToKeysym( |
+ gfx::GetXDisplay(), keycode, 0, 1)); |
+} |
+ |
+} // namespace keyboard_lock |