Thank you. Here is my macroAction() function. It’s astoundingly long, I think. Also I use preprocessor code and a quick search and replace to deal with which Keyboard I’m flashing. (I’m using Kaleidoscope with the same basic sketch with both my Keyboardios and my ErgoDox). That “one sketch for all” concept is why I’m using Macros when they wouldn’t seem to be necessary.
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
switch (macroIndex) {
case cents:
return MACRODOWN(
T(C), T(T), T(Period));
break;
case copyright:
return MACRODOWN(
D(LeftShift), T(9), T(C), T(0), U(LeftShift));
break;
case doubleComma:
return MACRODOWN(
D(Comma), D(Comma));
break;
case doubleDash:
return MACRODOWN(
T(Minus), T(Minus));
break;
case lDAQ:
return MACRODOWN(
D(LeftShift), T(Period), T(Period), U(LeftShift));
break;
case plusminus:
return MACRODOWN(
D(LeftShift), T(Equals), U(LeftShift), T(Slash), T(Minus));
break;
case pounds:
return MACRODOWN(
T(L), T(B), T(Period));
break;
case rDAQ:
return MACRODOWN(
D(LeftShift), T(Comma), T(Comma), U(LeftShift));
break;
case Registered:
return MACRODOWN(
D(LeftShift), T(9), T(R), T(0), U(LeftShift));
break;
case triplePeriod:
return MACRODOWN(
T(Period), T(Period), T(Period));
break;
#if INTERNATIONAL_KEYBOARD > 0
case apostroUSN:
return MACRODOWN(
T(Quote), T(Spacebar));
break;
case incUSN:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), T(Spacebar));
break;
case libra:
return MACRODOWN(
D(RightAlt), D(LeftShift), T(4), U(LeftShift), T(Spacebar), U(RightAlt));
break;
case yen:
return MACRODOWN(
D(RightAlt), T(Minus), D(RightAlt));
break;
case yDiaUSN:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), T(Y));
break;
#else
case apostroUSN:
return MACRODOWN(
T(Quote));
break;
case incUSN:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift));
break;
case libra:
return MACRODOWN(
D(RightAlt), D(LeftShift), T(4), U(LeftShift), T(Spacebar), U(RightAlt));
break;
case yen:
return MACRODOWN(
T(Y), T(E), T(N));
break;
case yDiaUSN:
return MACRODOWN(
T(I), T(J));
break;
#endif
#if INTERNATIONAL_KEYBOARD > 3
case aDiaUSN:
return MACRODOWN(
Dr(Key_RightAlt), T(Q), Ur(Key_RightAlt));
break;
case agMCN:
return MACRODOWN(
Dr(Key_RightAlt), T(G), Ur(Key_RightAlt));
break;
case backtick:
return MACRODOWN(
Dr(Key_RightAlt), D(Backtick), Ur(Key_RightAlt));
break;
case caUSN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(6), U(LeftShift), Ur(Key_RightAlt));
break;
case e_diares:
return MACRODOWN(
Dr(Key_RightAlt), D(V), Ur(Key_RightAlt));
break;
case eshMCN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(Slash), U(LeftShift), Ur(Key_RightAlt), T(S));
break;
case ezhMCN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(7), U(LeftShift), Ur(Key_RightAlt), T(Z));
break;
case gBrev_MN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(Backslash), U(LeftShift), Ur(Key_RightAlt), T(G));
break;
case lowDQuot:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), D(B), U(LeftShift), Ur(Key_RightAlt));
break;
case IPAepsilon:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(7), U(LeftShift), Ur(Key_RightAlt), T(3));
break;
case IPAturnedC:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(7), U(LeftShift), Ur(Key_RightAlt), T(C));
break;
case lange_ij:
return MACRODOWN(
Dr(Key_RightAlt), D(J), Ur(Key_RightAlt));
break;
case leftHighDDQu:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(0), U(LeftShift), Ur(Key_RightAlt));
break;
case lowQuote:
return MACRODOWN(
Dr(Key_RightAlt), D(B), Ur(Key_RightAlt));
break;
case mid_dot:
return MACRODOWN(
Dr(Key_RightAlt), D(X), Ur(Key_RightAlt));
break;
case not_sign:
return MACRODOWN(
Dr(Key_RightAlt), D(Backslash), Ur(Key_RightAlt));
break;
case oe_ligat:
return MACRODOWN(
Dr(Key_RightAlt), D(K), Ur(Key_RightAlt));
break;
case rightHighDoubQu:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(9), U(LeftShift), Ur(Key_RightAlt));
break;
case sCar_MN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(Period), U(LeftShift), Ur(Key_RightAlt), T(S));
break;
case schwaMCN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(7), U(LeftShift), Ur(Key_RightAlt), T(E));
break;
case smUDOmMCN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(7), U(LeftShift), Ur(Key_RightAlt), T(U));
break;
case softHyph:
return MACRODOWN(
Dr(Key_RightAlt), D(7), Ur(Key_RightAlt));
break;
case yogh_MN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(7), U(LeftShift), Ur(Key_RightAlt), T(Y));
break;
case zCar_MN:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(Period), U(LeftShift), Ur(Key_RightAlt), T(Z));
break;
#elif INTERNATIONAL_KEYBOARD > 0
case aDiaUSN:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), T(A));
break;
case backtick:
return MACRODOWN(
D(Backtick), T(Spacebar));
break;
case caUSN:
return MACRODOWN(
D(LeftShift), T(6), U(LeftShift), T(Spacebar));
break;
case e_diares:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), T(E));
break;
case gBrev_MN:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), T(Y));
break;
case lowDQuot:
return MACRODOWN(
D(Comma), D(Comma));
break;
case lange_ij:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), T(Y));
break;
case leftHighDDQu:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), U(Space));
break;
case lowQuote:
return MACRODOWN(
D(Comma));
break;
case oe_ligat:
return MACRODOWN(
D(O), D(E));
break;
case mid_dot:
return MACRODOWN(
T(Period));
break;
case not_sign:
return MACRODOWN(
Dr(Key_RightAlt), D(1), Ur(Key_RightAlt));
break;
case rightHighDoubQu:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift), T(Space));
break;
case sCar_MN:
return MACRODOWN(
T(S), T(H));
break;
case softHyph:
return MACRODOWN(
D(Minus));
break;
case yogh_MN:
return MACRODOWN(
T(G), T(H));
break;
case zCar_MN:
return MACRODOWN(
T(Z), T(H));
break;
#else
case backtick:
return MACRODOWN(
D(Backtick));
break;
case caUSN:
return MACRODOWN(
D(LeftShift), T(6), U(LeftShift));
break;
case e_diares:
return MACRODOWN(
T(E));
break;
case gBrev_MN:
return MACRODOWN(
T(Y));
break;
case lowDQuot:
return MACRODOWN(
D(Comma), D(Comma));
break;
case lange_ij:
return MACRODOWN(
D(I), D(J));
break;
case leftHighDDQu:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift));
break;
case lowQuote:
return MACRODOWN(
D(Comma));
break;
case oe_ligat:
return MACRODOWN(
D(O), D(E));
break;
case mid_dot:
return MACRODOWN(
T(Period));
break;
case rightHighDoubQu:
return MACRODOWN(
D(LeftShift), T(Quote), U(LeftShift));
break;
case sCar_MN:
return MACRODOWN(
T(S), T(H));
break;
case softHyph:
return MACRODOWN(
D(Minus));
break;
case yogh_MN:
return MACRODOWN(
T(G), T(H));
break;
case zCar_MN:
return MACRODOWN(
T(Z), T(H));
break;
#endif
#if WITH_UNICODE > 0
case a0250:
unicode(0x0250, keyState);
break;
case asp02b0:
unicode(0x02b0, keyState);
break;
case beta03b2:
unicode(0x03b2, keyState);
break;
case blank_UN:
unicode(0x2205, keyState);
break;
case brokenBar:
unicode(0x00a6, keyState);
break;
case dotlessI0131:
unicode(0x0131, keyState);
break;
case em_DashUN:
unicode(0x2014, keyState);
break;
case en_DashUN:
unicode(0x2013, keyState);
break;
case enye272:
unicode(0x0272, keyState);
break;
case horEllipse:
unicode(0x2026, keyState);
break;
case IPAg263:
unicode(0x263, keyState);
break;
case IPAr0279:
unicode(0x279, keyState);
break;
case longS_UN:
unicode(0x017f, keyState);
break;
case longum02d0:
unicode(0x02d0, keyState);
break;
case lfSngAnQ:
unicode(0x203a, keyState);
break;
case plusminusUN:
unicode(0x00B1, keyState);
break;
case rtSngAnQ:
unicode(0x2039, keyState);
break;
case smCapI026a:
unicode(0x026a, keyState);
break;
case startUnicode:
return MACRODOWN(
D(LeftAlt), D(LeftGui), T(Spacebar), U(LeftGui), U(LeftAlt), Dr(Key_RightAlt));
break;
case stopUnicode:
return MACRODOWN(
Ur(Key_RightAlt), D(LeftAlt), D(LeftGui), T(Spacebar), U(LeftGui), U(LeftAlt));
break;
case theta3B8:
unicode(0x03b8, keyState);
break;
#elif INTERNATIONAL_KEYBOARD > 0
case blank_UN:
return MACRODOWN(
Dr(Key_RightAlt), T(4), Ur(Key_RightAlt));
break;
case brokenBar:
return MACRODOWN(
Dr(Key_RightAlt), D(LeftShift), T(Backslash), U(LeftShift), Ur(Key_RightAlt));
break;
case em_DashUN:
return MACRODOWN(
T(Minus), T(Minus));
break;
case en_DashUN:
return MACRODOWN(
T(Minus), T(Minus));
break;
case horEllipse:
return MACRODOWN(
T(Period), T(Period), T(Period));
break;
case lfSngAnQ:
return MACRODOWN(
D(LeftShift), T(Period), U(LeftShift));
break;
case longS_UN:
return MACRODOWN(
T(S), T(S));
break;
case plusminusUN:
return MACRODOWN(
D(LeftShift), T(Equals), U(LeftShift), T(Slash), T(Minus));
break;
case rtSngAnQ:
return MACRODOWN(
D(LeftShift), T(Comma), U(LeftShift));
break;
#else
case blank_UN:
return MACRODOWN(
D(LeftShift), T(X), U(LeftShift));
break;
case brokenBar:
return MACRODOWN(
D(LeftShift), T(Backslash), U(LeftShift));
break;
case em_DashUN:
return MACRODOWN(
T(Minus), T(Minus));
break;
case en_DashUN:
return MACRODOWN(
T(Minus), T(Minus));
break;
case horEllipse:
return MACRODOWN(
T(Period), T(Period), T(Period));
break;
case lfSngAnQ:
return MACRODOWN(
D(LeftShift), T(Period), U(LeftShift));
break;
case longS_UN:
return MACRODOWN(
T(S), T(S));
break;
case plusminusUN:
return MACRODOWN(
D(LeftShift), T(Equals), U(LeftShift), T(Slash), T(Minus));
break;
case rtSngAnQ:
return MACRODOWN(
D(LeftShift), T(Comma), U(LeftShift));
break;
#endif
}
return MACRO_NONE;
}