Hello. I’m trying to set up hitting the two Fn keys together to put my system to sleep as I didn’t want to put the System_Sleep
key on a keymap for fear of accidentally pressing it (to avoid the hassle of waking it up again and entering the password). As per the example given in the MagicCombo plugin, my code is:
void magicSleep(uint8_t combo_index)
{
MACRODOWN(Tr(System_Sleep));
}
USE_MAGIC_COMBOS(
[MAGIC_SLEEP] = {
.action = magicSleep,
.keys = {R3C6, R3C9} // Left Fn + Right Fn
});
but upon doing make flash
I’m getting the following errors:
BOARD_HARDWARE_PATH="/home/samjnaa/Arduino/hardware" /home/samjnaa/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.22-15-g173c-dirty) ...
In file included from /home/samjnaa/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/key_events.h:6:0,
from /home/samjnaa/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/Kaleidoscope.h:24,
from /home/samjnaa/Arduino/Model01-Firmware/Model01-Firmware.ino:6:
/home/samjnaa/Arduino/Model01-Firmware/Model01-Firmware.ino: In function 'void magicSleep(uint8_t)':
/home/samjnaa/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Macros/src/MacroSteps.h:22:38: error: 'keyState' was not declared in this scope
#define MACRODOWN(...) (keyToggledOn(keyState) ? MACRO(__VA_ARGS__) : MACRO_NONE)
^
/home/samjnaa/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/keyswitch_state.h:17:35: note: in definition of macro 'keyIsPressed'
#define keyIsPressed(keyState) ((keyState) & IS_PRESSED)
^
/home/samjnaa/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Macros/src/MacroSteps.h:22:25: note: in expansion of macro 'keyToggledOn'
#define MACRODOWN(...) (keyToggledOn(keyState) ? MACRO(__VA_ARGS__) : MACRO_NONE)
^
/home/samjnaa/Arduino/Model01-Firmware/Model01-Firmware.ino:153:5: note: in expansion of macro 'MACRODOWN'
MACRODOWN(Tr(System_Sleep));
^
/home/samjnaa/Arduino/Model01-Firmware/Model01-Firmware.ino: At global scope:
/home/samjnaa/Arduino/Model01-Firmware/Model01-Firmware.ino:156:17: error: expected constructor, destructor, or type conversion before '(' token
USE_MAGIC_COMBOS(
^
exit status 1
/home/samjnaa/Arduino/hardware/keyboardio/avr/build-tools/makefiles//rules.mk:72: recipe for target 'flash' failed
make: *** [flash] Error 1
It looks like it is looking for a parameter keyState
but which is not defined by the combo handler (as per the example). Kindly advise as to how this is to be fixed. Thank you!