]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/KeyModifier.h
de.po
[lyx.git] / src / frontends / KeyModifier.h
index 7c8035f91ff784e85141573d2f32d785c9d08d43..b900b14650695d8c81dc01400b48b7d62dce1fad 100644 (file)
 
 namespace lyx {
 
-/// modifier key states
+/// Set of KeyModifierFlags
+typedef unsigned int KeyModifier;
 
-enum KeyModifier {
-       NoModifier       = 0, //< no modifiers held
-       ControlModifier  = 1, //< control button held
-       AltModifier      = 2, //< alt/meta key held
-       ShiftModifier    =  4  //< shift key held
+/// modifier key states
+enum KeyModifierFlags : unsigned int {
+       NoModifier       = 0,      //< no modifiers held
+       ControlModifier  = 1 << 0, //< control button held
+       AltModifier      = 1 << 1, //< alt key held
+       ShiftModifier    = 1 << 2, //< shift key held
+       MetaModifier     = 1 << 3  //< meta key held
 };
 
-
-inline KeyModifier operator|(KeyModifier s1, KeyModifier s2)
-{
-       int const i1 = static_cast<int>(s1);
-       int const i2 = static_cast<int>(s2);
-       return static_cast<KeyModifier>(i1 | i2);
-}
-
-
-inline void operator|=(KeyModifier & s1, KeyModifier s2)
-{
-       s1 = static_cast<KeyModifier>(s1 | s2);
-}
-
-
 } // namespace lyx
 
 #endif // KEYMODIFIER_H