Hey walrus, I’m not a programmer, and I was able to figure this out. You can do it if you like to tinker.
-
I’m going to assume that you downloaded the latest version of the firmware and flashed it using Arduino IDE, instructions here: https://github.com/keyboardio/Model01-Firmware
-
Make sure that you read about creating macros here: https://github.com/keyboardio/Kaleidoscope-Macros
-
As the instructions say, “To use the plugin, we need to include the header, tell the firmware to use the plugin, place macros on the keymap, and create a special handler function (macroAction) that will tell the plugin what shall happen when macro keys are pressed.”
The following is from my keyboard firmware. It might look confusing at first, but most of those things are already in the firmware. All you have to do is add the macros you want to create, add them somewhere on your keymap, and then tell your keyboard what the macro is supposed to do. For mine, I’ve got a macro for a program launcher (a shortcut I designed to be Ctrl+Cmd+Opt+Shift+L), a macro to activate a program called Moom (Ctrl+Cmd+Opt+Shift+M), a macro to add a reference when I am using Word (Ctrl+Cmd+Opt+Shift+Z), and a macro to add a footnote in Word (Ctrl+Cmd+Opt+Shift+F). Note that for all of these shortcuts, I first defined them either for my operating system or for Microsoft Word. Probably the best thing to do is take a crack at it, and then post your firmware sketch if it doesn’t work.
/* Here is the header (included by default, so you don't have to do anything to this): */
#include <Kaleidoscope.h>
#include <Kaleidoscope-Macros.h>
/* Giving a name to my macros; on your sketch you'll see the default macros named here, and you can just add to the list. I'm pretty sure "enum" is short for "enumerate." */
enum {
M_LAUNCH,
M_MOOM,
M_ZOTERO,
M_FOOTNOTE
};
// In the keymap you will include "M(YourMacroName)" (i.e., instead of Key_Gui I might put "M(M_LAUNCH)"
First M is to tell that this is a macro, the second M is part of the name of the Macro I have created */
M(M_LAUNCH), M(M_MOOM), M(M_ZOTERO), M(M_FOOTNOTE)
// I put this function right after the keycaps in my firmware; it tells the keyboard what to do when handling my macros:
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
switch (macroIndex) {
case M_LAUNCH:
return MACRODOWN(D(LeftShift), D(LeftAlt), D(LeftControl), D(LeftGui), D(L));
break;
case M_MOOM:
return MACRODOWN(D(LeftShift), D(LeftAlt), D(LeftControl), D(LeftGui), D(Tab));
break;
case M_ZOTERO:
return MACRODOWN(D(LeftShift), D(LeftAlt), D(LeftControl), D(LeftGui), D(Z));
break;
case M_FOOTNOTE:
return MACRODOWN(D(LeftShift), D(LeftAlt), D(LeftControl), D(LeftGui), D(F));
break;
}
return MACRO_NONE;
}
KALEIDOSCOPE_INIT_PLUGINS(Macros);
void setup() {
Kaleidoscope.setup ();
}
/* You have to include "Macros" in the initialization of your plugins, but again this is done by default */