X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FKeyModifier.h;h=b900b14650695d8c81dc01400b48b7d62dce1fad;hb=40a331abfdf9c774fd767d53dcdb578afd14da51;hp=fba80bec2a5977843ac15a31f2bc12bee83f698e;hpb=e9d943aeb8bbe5fb211977c84160813cfcbecb34;p=lyx.git diff --git a/src/frontends/KeyModifier.h b/src/frontends/KeyModifier.h index fba80bec2a..b900b14650 100644 --- a/src/frontends/KeyModifier.h +++ b/src/frontends/KeyModifier.h @@ -16,31 +16,18 @@ 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 key held - ShiftModifier = 4, //< shift key held - MetaModifier = 8 //< meta 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(s1); - int const i2 = static_cast(s2); - return static_cast(i1 | i2); -} - - -inline void operator|=(KeyModifier & s1, KeyModifier s2) -{ - s1 = static_cast(s1 | s2); -} - - } // namespace lyx #endif // KEYMODIFIER_H