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

Unified Diff: ui/ozone/platform/wayland/wayland_xkb_keyboard_layout_engine.h

Issue 2639053002: [ozone/wayland] Implement basic keyboard handling support (Closed)
Patch Set: addressed kpschoedel's review Created 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/wayland/wayland_xkb_keyboard_layout_engine.h
diff --git a/ui/ozone/platform/wayland/wayland_xkb_keyboard_layout_engine.h b/ui/ozone/platform/wayland/wayland_xkb_keyboard_layout_engine.h
new file mode 100644
index 0000000000000000000000000000000000000000..11020be5aebf908b781e0d227e2041da77d04822
--- /dev/null
+++ b/ui/ozone/platform/wayland/wayland_xkb_keyboard_layout_engine.h
@@ -0,0 +1,38 @@
+// 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.
+
+#ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_XKB_KEYBOARD_LAYOUT_ENGINE_H_
+#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_XKB_KEYBOARD_LAYOUT_ENGINE_H_
+
+#include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
+
+#include "ui/events/ozone/layout/xkb/xkb_key_code_converter.h"
+
+namespace ui {
+
+class WaylandXkbKeyboardLayoutEngine : public XkbKeyboardLayoutEngine {
+ public:
+ WaylandXkbKeyboardLayoutEngine(const XkbKeyCodeConverter& converter);
+
+ // Used to sync up client side 'xkb_state' instance with modifiers status
+ // update from the compositor.
+ int UpdateModifiers(uint32_t depressed_mods,
+ uint32_t latched_mods,
+ uint32_t locked_mods,
+ uint32_t group);
+
+ private:
+ void SetKeymap(xkb_keymap* keymap) override;
+
+ // Cache to access modifiers xkb_mode_index_t value.
+ struct {
+ xkb_mod_index_t control = 0;
+ xkb_mod_index_t alt = 0;
+ xkb_mod_index_t shift = 0;
+ } xkb_mod_indexes_;
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_
« no previous file with comments | « ui/ozone/platform/wayland/wayland_window.cc ('k') | ui/ozone/platform/wayland/wayland_xkb_keyboard_layout_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698