// Other declarations would go here, separated by commas, if you have them
};
enummy_macros{
NEWDESK=0,
LEFTDESK,
RIGHTDESK,
CLOSEDESK
};
constmacro_t*action_get_macro(keyrecord_t*record,uint8_tid,uint8_topt)// this is the function signature -- just copy/paste it into your keymap file as it is.
{
switch(id){
case0:// this would trigger when you hit a key mapped as M(0)
caseNEWDESK: // this would trigger when you hit a key mapped as M(0)
if(record->event.pressed){
returnMACRO(I(1),D(LGUI),D(LCTL),D(D),U(LGUI),U(LCTL),U(D),END);// NEW DESKTOP
}
break;
case1: // this would trigger when you hit a key mapped as M(0)
caseLEFTDESK: // this would trigger when you hit a key mapped as M(0)
if(record->event.pressed){
returnMACRO(I(1),D(LGUI),D(LCTL),D(LEFT),U(LGUI),U(LCTL),U(LEFT),END);// LEFT DESKTOP
}
break;
case2: // this would trigger when you hit a key mapped as M(0)
caseRIGHTDESK: // this would trigger when you hit a key mapped as M(0)
if(record->event.pressed){
returnMACRO(I(1),D(LGUI),D(LCTL),D(RGHT),U(LGUI),U(LCTL),U(RGHT),END);// RIGHT DESKTOP
}
break;
case3: // this would trigger when you hit a key mapped as M(0)
caseCLOSEDESK: // this would trigger when you hit a key mapped as M(0)
if(record->event.pressed){
returnMACRO(I(1),D(LGUI),D(LCTL),D(F4),U(LGUI),U(LCTL),U(F4),END);// CLOSE DESKTOP