alecAbstraction Layer for Escape Codes |
git clone git://git.dimitrijedobrota.com/alec.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING | |
commit | aee951d624bef631e5adf2461b8d8b86d0f1b801 |
parent | 945169ba2c508fb533f155c9915ff6476dfa9ef3 |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Sat, 15 Feb 2025 15:57:37 +0100 |
Return event fields by reference for later change
Diffstat:M | CMakeLists.txt | | | +- |
M | source/alec.rules.hpp | | | +++++++++---- |
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -4,7 +4,7 @@ include(cmake/prelude.cmake)
project(
alec
VERSION 0.1.14
VERSION 0.1.15
DESCRIPTION "Abstraction Layer for Escape Codes"
HOMEPAGE_URL "git://git.dimitrijedobrota.com/alec.git"
LANGUAGES CXX
diff --git a/source/alec.rules.hpp b/source/alec.rules.hpp
@@ -578,16 +578,21 @@ public:
MOTION = 8,
};
event(Type type, uint8_t mod_mask, uint8_t key)
event(Type type, uint8_t mod_mask, uint8_t key) // NOLINT
: m_type(type)
, m_mod_mask(mod_mask)
, m_key(key)
{
}
auto type() const { return m_type; }
auto key() const { return m_key; }
auto mod_mask() const { return m_mod_mask; }
const auto& type() const { return m_type; }
auto& type() { return m_type; }
const auto& key() const { return m_key; }
auto& key() { return m_key; }
const auto& mod_mask() const { return m_mod_mask; }
auto& mod_mask() { return m_mod_mask; }
bool is_set(uint8_t mask) const { return mask == (m_mod_mask & mask); }