From 42afb7d2bd20cafccbe6cc8cf3da44408693c76d Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Thu, 4 Apr 2019 12:31:39 +0200 Subject: [PATCH] Introduced UnknownKeyswitchLocation This is a macro that defines an invalid key address. It can furtheron be used as a flag value. Signed-off-by: Florian Fleissner --- src/kaleidoscope/key_events.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/kaleidoscope/key_events.h b/src/kaleidoscope/key_events.h index 705cf1b3..0c124e05 100644 --- a/src/kaleidoscope/key_events.h +++ b/src/kaleidoscope/key_events.h @@ -25,6 +25,14 @@ // Code can use this macro on injected key events to signal that // the event isn't tied to a specific physical keyswitch #define UNKNOWN_KEYSWITCH_LOCATION 255,255 + +// UnknownKeyswitchLocation represents an invalid (as default constructed) +// key address. Note: This is not a constexpr as it turned out +// that the compiler would instanciate it and store it in RAM if +// not made a temporary. +// +#define UnknownKeyswitchLocation KeyAddr(KeyAddr::invalid_state) + // Conversely, if an injected event *is* tied to a physical keyswitch and should // be resolved by the current keymap, code can use Key_NoKey on the injected event // with a real (row, col) location