1 // Copyright 2013 Intel Corporation. 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 #ifndef OZONE_UI_EVENTS_INPUT_KEYBOARD_ENGINE_XKB_H_
6 #define OZONE_UI_EVENTS_INPUT_KEYBOARD_ENGINE_XKB_H_
8 #include <xkbcommon/xkbcommon.h>
10 #include "base/basictypes.h"
14 class KeyboardEngineXKB {
19 void OnKeyboardKeymap(int fd, uint32_t size);
20 void OnKeyModifiers(uint32_t mods_depressed,
21 uint32_t mods_latched,
24 unsigned ConvertKeyCodeFromEvdev(unsigned hardwarecode);
26 uint32_t GetKeyBoardModifiers() const { return keyboard_modifiers_; }
31 bool IsOnlyCapsLocked() const;
34 // Keeps track of the currently active keyboard modifiers. We keep this
35 // since we want to advertise keyboard modifiers with mouse events.
36 uint32_t keyboard_modifiers_;
37 uint32_t mods_depressed_;
38 uint32_t mods_latched_;
39 uint32_t mods_locked_;
42 uint32_t last_modifiers_;
43 xkb_keysym_t cached_sym_;
45 // keymap used to transform keyboard events.
46 struct xkb_keymap *keymap_;
47 struct xkb_state *state_;
48 struct xkb_context *context_;
50 DISALLOW_COPY_AND_ASSIGN(KeyboardEngineXKB);
55 #endif // OZONE_UI_EVENTS_INPUT_KEYBOARD_ENGINE_XKB_H_