changed definitions on keymap.c in admiral strokers

Made a few changes to my own keymaps. (organisation)
daktil_manuform
Ole Anders 2017-03-07 19:40:18 +01:00
parent 25a7c94174
commit 1968ec4c24
1 changed files with 109 additions and 104 deletions

View File

@ -144,39 +144,44 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function
static uint16_t key_timer;
bool checkTime(){
return (timer_elapsed(key_timer) < 150) ? true : false;
}
switch(id) {
case 0: //MAC0 - Hold for lshift and { on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(LSFT), END );
} else {
return (timer_elapsed(key_timer) < 150) ? MACRO(U(LSFT),D(RALT),T(7),U(RALT),END): MACRO(U(LSFT),END);
return checktime() ? MACRO(U(LSFT),D(RALT),T(7),U(RALT),END): MACRO(U(LSFT),END);
}; break;
case 1: //MAC1 - Hold for rshift and } on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(RSFT), END );
} else {
return (timer_elapsed(key_timer) < 150) ? MACRO(U(RSFT),D(RALT),T(0),U(RALT),END): MACRO(U(RSFT),END);
return checktime() ? MACRO(U(RSFT),D(RALT),T(0),U(RALT),END): MACRO(U(RSFT),END);
}; break;
case 2: //MAC2 - Hold for lctrl and [ on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(LCTL), END );
} else {return (timer_elapsed(key_timer) < 150) ? MACRO(U(LCTL),D(RALT),T(8),U(RALT),END):MACRO(U(LCTL),END);
} else {return checktime() ? MACRO(U(LCTL),D(RALT),T(8),U(RALT),END):MACRO(U(LCTL),END);
}; break;
case 3: //MAC3 - Hold for rctrl and ] on tap
if (record->event.pressed) {
key_timer = timer_read();
return MACRO(D(RCTL), END );
} else {
return (timer_elapsed(key_timer) < 150) ? MACRO(U(RCTL),D(RALT),T(9),U(RALT),END):MACRO(U(RCTL),END);
return checktime() ? MACRO(U(RCTL),D(RALT),T(9),U(RALT),END):MACRO(U(RCTL),END);
}; break;
case 4: //MAC4
case 4: //MAC4 reserved for later.
if (record->event.pressed) { } else { }; break;
case 5: //MAC5
case 5: //MAC5 reserved for later.
if (record->event.pressed) { } else { }; break;
case 6: //MAC6
case 6: //MAC6 reserved for later.
if (record->event.pressed) { } else { }; break;
} return MACRO_NONE;
};