aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/ScintillaTypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ScintillaTypes.h')
-rw-r--r--include/ScintillaTypes.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/ScintillaTypes.h b/include/ScintillaTypes.h
index 343dec749..5fc18b71b 100644
--- a/include/ScintillaTypes.h
+++ b/include/ScintillaTypes.h
@@ -818,6 +818,15 @@ constexpr KeyMod operator&(KeyMod a, KeyMod b) noexcept {
return static_cast<KeyMod>(static_cast<int>(a) & static_cast<int>(b));
}
+constexpr KeyMod ModifierFlags(bool shift, bool ctrl, bool alt, bool meta=false, bool super=false) noexcept {
+ return
+ (shift ? KeyMod::Shift : KeyMod::Norm) |
+ (ctrl ? KeyMod::Ctrl : KeyMod::Norm) |
+ (alt ? KeyMod::Alt : KeyMod::Norm) |
+ (meta ? KeyMod::Meta : KeyMod::Norm) |
+ (super ? KeyMod::Super : KeyMod::Norm);
+}
+
// Test if an enum class value has some bit flag(s) of test set.
template <typename T>
constexpr bool FlagSet(T value, T test) {