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 <florian.fleissner@inpartik.de>
pull/640/head
Florian Fleissner 6 years ago committed by Jesse Vincent
parent be2204851a
commit 42afb7d2bd

@ -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

Loading…
Cancel
Save