]> git.lyx.org Git - lyx.git/blob - src/frontends/KeyModifier.h
Migrate GuiLabel to InsetParamsDialog.
[lyx.git] / src / frontends / KeyModifier.h
1 // -*- C++ -*-
2 /**
3  * \file KeyModifier.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * Keyboard modifier state representation.
8  *
9  * \author John Levon
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef KEYMODIFIER_H
15 #define KEYMODIFIER_H
16
17 namespace lyx {
18
19 /// modifier key states
20
21 enum KeyModifier {
22         NoModifier       = 0, //< no modifiers held
23         ControlModifier  = 1, //< control button held
24         AltModifier      = 2, //< alt/meta key held
25         ShiftModifier    = 4  //< shift key held
26 };
27
28
29 inline KeyModifier operator|(KeyModifier s1, KeyModifier s2)
30 {
31         int const i1 = static_cast<int>(s1);
32         int const i2 = static_cast<int>(s2);
33         return static_cast<KeyModifier>(i1 | i2);
34 }
35
36
37 inline void operator|=(KeyModifier & s1, KeyModifier s2)
38 {
39         s1 = static_cast<KeyModifier>(s1 | s2);
40 }
41
42
43 } // namespace lyx
44
45 #endif // KEYMODIFIER_H