summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keys.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/keys.hh b/src/keys.hh
index f754ce68..c83e1361 100644
--- a/src/keys.hh
+++ b/src/keys.hh
@@ -57,11 +57,11 @@ struct Key
constexpr Key(Codepoint key)
: modifiers(Modifiers::None), key(key) {}
- constexpr bool operator==(Key other) const
- { return modifiers == other.modifiers and key == other.key; }
+ constexpr uint64_t val() const { return (uint64_t)modifiers << 32 | key; }
- constexpr bool operator!=(Key other) const
- { return modifiers != other.modifiers or key != other.key; }
+ constexpr bool operator==(Key other) const { return val() == other.val(); }
+ constexpr bool operator!=(Key other) const { return val() != other.val(); }
+ constexpr bool operator<(Key other) const { return val() < other.val(); }
};
template<> struct WithBitOps<Key::Modifiers> : std::true_type {};