From 6d3ed7d6e5ea536afdd4e6cc3da7e0b8d0e64e1b Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Tue, 19 Dec 2017 15:43:32 +0100 Subject: [PATCH] Allow for constructor call based creation of instances of Key_ --- src/kaleidoscope/key_defs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/kaleidoscope/key_defs.h b/src/kaleidoscope/key_defs.h index 8ae7fa36..b4c03ad1 100644 --- a/src/kaleidoscope/key_defs.h +++ b/src/kaleidoscope/key_defs.h @@ -42,6 +42,16 @@ union Key { }; uint16_t raw; + Key() = default; + + constexpr Key(uint8_t __keyCode, uint8_t __flags) + : keyCode(__keyCode), flags(__flags) { + } + + constexpr Key(uint16_t __raw) + : raw(__raw) { + } + constexpr bool operator==(const uint16_t rhs) const { return this->raw == rhs; }