Fixed `QUKEYS()` macro for defining qukeys in sketch

pull/389/head
Michael Richters 7 years ago
parent b51d679939
commit cb16b32215

@ -27,14 +27,12 @@ void setup() {
// Use Qukeys // Use Qukeys
Kaleidoscope.use(&Qukeys); Kaleidoscope.use(&Qukeys);
static kaleidoscope::Qukey qukeys[] = { QUKEYS(
kaleidoscope::Qukey(0, 2, 1, Key_LeftGui), // A/cmd kaleidoscope::Qukey(0, 2, 1, Key_LeftGui), // A/cmd
kaleidoscope::Qukey(0, 2, 2, Key_LeftAlt), // S/alt kaleidoscope::Qukey(0, 2, 2, Key_LeftAlt), // S/alt
kaleidoscope::Qukey(0, 2, 3, Key_LeftControl), // D/ctrl kaleidoscope::Qukey(0, 2, 3, Key_LeftControl), // D/ctrl
kaleidoscope::Qukey(0, 2, 4, Key_LeftShift) // F/shift kaleidoscope::Qukey(0, 2, 4, Key_LeftShift) // F/shift
}; )
Qukeys.qukeys_ = qukeys;
Qukeys.qukeys_count_ = sizeof(qukeys) / sizeof(kaleidoscope::Qukey);
Kaleidoscope.setup(); Kaleidoscope.setup();
} }

@ -80,6 +80,7 @@ class Qukeys : public KaleidoscopePlugin {
static void deactivate(void) { static void deactivate(void) {
active_ = false; active_ = false;
} }
static int8_t lookupQukey(uint8_t key_addr); static int8_t lookupQukey(uint8_t key_addr);
static void enqueue(uint8_t key_addr); static void enqueue(uint8_t key_addr);
static int8_t searchQueue(uint8_t key_addr); static int8_t searchQueue(uint8_t key_addr);
@ -108,8 +109,6 @@ extern kaleidoscope::Qukeys Qukeys;
// macro for use in sketch file to simplify definition of qukeys // macro for use in sketch file to simplify definition of qukeys
#define QUKEYS(qukey_defs...) \ #define QUKEYS(qukey_defs...) \
namespace kaleidoscope { \ static kaleidoscope::Qukey qukeys[] = { qukey_defs }; \
Qukey qukeys[] = { qukey_defs... }; \ Qukeys.qukeys_ = qukeys; \
uint8_t qukeys_count = sizeof(qukeys) / sizeof(Qukey); \ Qukeys.qukeys_count_ = sizeof(qukeys) / sizeof(kaleidoscope::Qukey);
Qukeys.init(qukeys, qukeys_count); \
}

Loading…
Cancel
Save