Fcitx
keysym.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2012-2015 CSSlayer <wengxt@gmail.com>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 
8 #ifndef FCITX_UTILS_KEYSYM_H
9 #define FCITX_UTILS_KEYSYM_H
10 
11 /// \addtogroup FcitxUtils
12 /// \{
13 /// \file
14 /// \brief Key sym related types.
15 
16 #include <cstdint>
17 #include <fcitx-utils/keysymgen.h> // IWYU pragma: export
18 #include <fcitx-utils/macros.h>
19 
20 namespace fcitx {
21 /// \brief KeyState to represent modifier keys.
22 enum class KeyState : uint32_t {
23  NoState = 0,
24  Shift = 1U << 0,
25  CapsLock = 1U << 1,
26  Ctrl = 1U << 2,
27  Alt = 1U << 3,
28  Mod1 = Alt,
29  Alt_Shift = Alt | Shift,
30  Ctrl_Shift = Ctrl | Shift,
31  Ctrl_Alt = Ctrl | Alt,
32  Ctrl_Alt_Shift = Ctrl | Alt | Shift,
33  NumLock = 1U << 4,
34  Mod2 = NumLock,
35  Hyper = 1U << 5,
36  Mod3 = Hyper,
37  Super = 1U << 6,
38  Mod4 = Super,
39  Mod5 = 1U << 7,
40  MousePressed = 1U << 8,
41  HandledMask = 1U << 24,
42  IgnoredMask = 1U << 25,
43  Super2 = 1U << 26, // Gtk virtual Super
44  Hyper2 = 1U << 27, // Gtk virtual Hyper
45  Meta = 1U << 28,
46  /*
47  * Key state that used internally for virtual key board.
48  *
49  * @since 5.1.0
50  */
51  Virtual = 1U << 29,
52  /**
53  * Whether a Key Press is from key repetition.
54  *
55  * @since 5.0.4
56  */
57  Repeat = 1U << 31,
58  UsedMask = 0x5c001fff,
59  SimpleMask = Ctrl_Alt_Shift | Super | Super2 | Hyper | Meta,
60 };
61 } // namespace fcitx
62 
63 #endif
Definition: action.cpp:17
KeyState
KeyState to represent modifier keys.
Definition: keysym.h:22
Whether a Key Press is from key repetition.