From d9c5d7022f04d1362939de615910df8f9e18c2a8 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 2 Jul 2018 23:44:32 +0200 Subject: Don't use an enum for MagicCombo. Since we use a dedicated function for the single magic combo we have, using an enum in this case is just more confusing than if we didn't. For this reason, drop the use of enum, and just specify the array directly. Thanks @obra for the suggestion! Signed-off-by: Gergely Nagy --- Model01-Firmware.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Model01-Firmware.ino') diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index cca405c..bc45ee3 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -297,6 +297,10 @@ enum { COMBO_TOGGLE_NKRO_MODE }; +/** A tiny wrapper, to be used by MagicCombo. + * This simply toggles the keyboard protocol via USBQuirks, and wraps it within + * a function with an unused argument, to match what MagicCombo expects. + */ static void toggleKeyboardProtocol(uint8_t combo_index) { USBQuirks.toggleKeyboardProtocol(); } @@ -304,10 +308,10 @@ static void toggleKeyboardProtocol(uint8_t combo_index) { /** Magic combo list, a list of key combo and action pairs the firmware should * recognise. */ -USE_MAGIC_COMBOS([COMBO_TOGGLE_NKRO_MODE] = {.action = toggleKeyboardProtocol, - // Left Fn + Esc + Shift - .keys = { R3C6, R2C6, R3C7 } - }); +USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol, + // Left Fn + Esc + Shift + .keys = { R3C6, R2C6, R3C7 } + }); // First, tell Kaleidoscope which plugins you want to use. // The order can be important. For example, LED effects are -- cgit v1.2.3