Created special shift keys for Morse layer that change variable value, enabling to send “shifted” special morse code characters.

example_keyboards
Ante Laurijssen 8 years ago
parent 8f80f35186
commit 7146dfea6e

@ -258,7 +258,9 @@ enum morse_macros {
// Custom Keys // Custom Keys
enum custom_keys { enum custom_keys {
MAGSYS, // Magic SysRq key - Sends Alt-PSCR MAGSYS = SAFE_RANGE, // Magic SysRq key - Sends Alt-PSCR
MC_LSFT,
MC_RSFT,
TFS = LCTL(LALT(KC_DEL)), // Three Finger Salute - Sends Ctl-Alt-Del TFS = LCTL(LALT(KC_DEL)), // Three Finger Salute - Sends Ctl-Alt-Del
}; };
@ -401,49 +403,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TO(0), MC_1, MC_2, MC_3, MC_4, MC_5, MC_6, MC_7, MC_8, MC_9, MC_0, KC_NO, KC_NO, KC_NO, KC_NO, \ TO(0), MC_1, MC_2, MC_3, MC_4, MC_5, MC_6, MC_7, MC_8, MC_9, MC_0, KC_NO, KC_NO, KC_NO, KC_NO, \
KC_TAB, MC_APOS, MC_COMM, MC_DOT, MC_P, MC_Y, MC_F, MC_G, MC_C, MC_R, MC_L, MC_SLSH, MC_EQL, KC_BSPC, \ KC_TAB, MC_APOS, MC_COMM, MC_DOT, MC_P, MC_Y, MC_F, MC_G, MC_C, MC_R, MC_L, MC_SLSH, MC_EQL, KC_BSPC, \
KC_NO, MC_A, MC_O, MC_E, MC_U, MC_I, MC_D, MC_H, MC_T, MC_N, MC_S, MC_MINS, KC_NO, KC_ENT, \ KC_NO, MC_A, MC_O, MC_E, MC_U, MC_I, MC_D, MC_H, MC_T, MC_N, MC_S, MC_MINS, KC_NO, KC_ENT, \
KC_LSFT, KC_NO, MC_SCLN, MC_Q, MC_J, MC_K, MC_X, MC_B, MC_M, MC_W, MC_V, MC_Z, KC_NO, KC_RSFT, KC_NO, \ MC_LSFT, KC_NO, MC_SCLN, MC_Q, MC_J, MC_K, MC_X, MC_B, MC_M, MC_W, MC_V, MC_Z, KC_NO, MC_RSFT, KC_NO, \
KC_NO, KC_NO, KC_NO, MC_SPACE, KC_NO, KC_NO, KC_NO, KC_NO KC_NO, KC_NO, KC_NO, MC_SPACE, KC_NO, KC_NO, KC_NO, KC_NO
), ),
}; };
// Custom Function - Check if shift is pressed
bool check_shift(void);
bool check_shift() {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT))) {
return KC_LSHIFT;
}
if (keyboard_report->mods & (MOD_BIT(KC_RSHIFT))) {
return KC_RSHIFT;
}
else {
return false;
}
}
// Morse Code Macros // Morse Code Macros
int mc_shift_on = false;
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
uint16_t is_shift = check_shift();
switch(id) { switch(id) {
case 0: //Number 0-) case 0: //Number 0-)
if (record->event.pressed) { if (record->event.pressed) {
if (is_shift == false) { if (mc_shift_on == true) {
return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //-----
}
else {
unregister_mods(MOD_BIT(is_shift));
return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.- return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.--.-
register_code(is_shift); }
else {
return MACRO(T(MINS), T(MINS), T(MINS), T(MINS), T(MINS), T(SPACE), END); //-----
} }
} }
break; break;
case 1: //Number 1-! case 1: //Number 1-!
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.-- return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-.--
} }
else { else {
@ -453,8 +437,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 2: //Number 2-@ case 2: //Number 2-@
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-. return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.--.-.
} }
else { else {
@ -464,16 +447,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 3: // Number 3 case 3: // Number 3
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...-- return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //...--
} }
break; break;
case 4: //Number 4-$ case 4: //Number 4-$
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..- return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-..-
} }
else { else {
@ -483,24 +462,17 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 5: //Number 5 case 5: //Number 5
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //..... return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.....
} }
break; break;
case 6: //Number 6 case 6: //Number 6
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-.... return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-....
} }
break; break;
case 7: //Number 7-& case 7: //Number 7-&
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-... return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.-...
} }
else { else {
@ -510,16 +482,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 8: //Number 8 case 8: //Number 8
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---.. return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //---..
} }
break; break;
case 9: //Number 9-( case 9: //Number 9-(
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--. return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //-.--.
} }
else { else {
@ -529,232 +497,149 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 10: //Letter A case 10: //Letter A
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(MINS), T(SPACE), END); //.- return MACRO(T(DOT), T(MINS), T(SPACE), END); //.-
} }
break; break;
case 11: //Letter B case 11: //Letter B
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-... return MACRO(T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //-...
} }
break; break;
case 12: //Letter C case 12: //Letter C
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-. return MACRO(T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //-.-.
} }
break; break;
case 13: //Letter D case 13: //Letter D
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-.. return MACRO(T(MINS), T(DOT), T(DOT), T(SPACE), END); //-..
} }
break; break;
case 14: //Letter E case 14: //Letter E
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(SPACE), END); //. return MACRO(T(DOT), T(SPACE), END); //.
} }
break; break;
case 15: //Letter F case 15: //Letter F
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-. return MACRO(T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //..-.
} }
break; break;
case 16: //Letter G case 16: //Letter G
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--. return MACRO(T(MINS), T(MINS), T(DOT), T(SPACE), END); //--.
} }
break; break;
case 17: //Letter H case 17: //Letter H
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //.... return MACRO(T(DOT), T(DOT), T(DOT), T(DOT), T(SPACE), END); //....
} }
break; break;
case 18: //Letter I case 18: //Letter I
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(SPACE), END); //.. return MACRO(T(DOT), T(DOT), T(SPACE), END); //..
} }
break; break;
case 19: //Letter J case 19: //Letter J
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.--- return MACRO(T(DOT), T(MINS), T(MINS), T(MINS), T(SPACE), END); //.---
} }
break; break;
case 20: //Letter K case 20: //Letter K
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.- return MACRO(T(MINS), T(DOT), T(MINS), T(SPACE), END); //-.-
} }
break; break;
case 21: //Letter L case 21: //Letter L
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-.. return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(SPACE), END); //.-..
} }
break; break;
case 22: //Letter M case 22: //Letter M
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(MINS), T(SPACE), END); //-- return MACRO(T(MINS), T(MINS), T(SPACE), END); //--
} }
break; break;
case 23: //Letter N case 23: //Letter N
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(DOT), T(SPACE), END); //-. return MACRO(T(MINS), T(DOT), T(SPACE), END); //-.
} }
break; break;
case 24: //Letter O case 24: //Letter O
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //--- return MACRO(T(MINS), T(MINS), T(MINS), T(SPACE), END); //---
} }
break; break;
case 25: //Letter P case 25: //Letter P
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--. return MACRO(T(DOT), T(MINS), T(MINS), T(DOT), T(SPACE), END); //.--.
} }
break; break;
case 26: //Letter Q case 26: //Letter Q
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.- return MACRO(T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //--.-
} }
break; break;
case 27: //Letter R case 27: //Letter R
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-. return MACRO(T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.
} }
break; break;
case 28: //Letter S case 28: //Letter S
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //... return MACRO(T(DOT), T(DOT), T(DOT), T(SPACE), END); //...
} }
break; break;
case 29: //Letter T case 29: //Letter T
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(SPACE), END); //- return MACRO(T(MINS), T(SPACE), END); //-
} }
break; break;
case 30: //Letter U case 30: //Letter U
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..- return MACRO(T(DOT), T(DOT), T(MINS), T(SPACE), END); //..-
} }
break; break;
case 31: //Letter V case 31: //Letter V
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...- return MACRO(T(DOT), T(DOT), T(DOT), T(MINS), T(SPACE), END); //...-
} }
break; break;
case 32: //Letter W case 32: //Letter W
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.-- return MACRO(T(DOT), T(MINS), T(MINS), T(SPACE), END); //.--
} }
break; break;
case 33: //Letter X case 33: //Letter X
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..- return MACRO(T(MINS), T(DOT), T(DOT), T(MINS), T(SPACE), END); //-..-
} }
break; break;
case 34: //Letter Y case 34: //Letter Y
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
} }
return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.-- return MACRO(T(MINS), T(DOT), T(MINS), T(MINS), T(SPACE), END); //-.--
} }
break; break;
case 35: //Letter Z case 35: //Letter Z
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--.. return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //--..
} }
break; break;
case 36: //Punctuation . case 36: //Punctuation .
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.- return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(MINS), T(SPACE), END); //.-.-.-
} }
break; break;
case 37: //Punctuation , case 37: //Punctuation ,
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..-- return MACRO(T(MINS), T(MINS), T(DOT), T(DOT), T(MINS), T(MINS), T(SPACE), END); //--..--
} }
break; break;
case 38: //Punctuation '-" case 38: //Punctuation '-"
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-. return MACRO(T(DOT), T(MINS), T(DOT), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-..-.
} }
else { else {
@ -764,8 +649,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 39: //Punctuation /-? case 39: //Punctuation /-?
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--.. return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(DOT), T(SPACE), END); //..--..
} }
else { else {
@ -775,8 +659,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 40: //Punctuation ;-: case 40: //Punctuation ;-:
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---... return MACRO(T(MINS), T(MINS), T(MINS), T(DOT), T(DOT), T(DOT), T(SPACE), END); //---...
} }
else { else {
@ -786,8 +669,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 41: //Punctuation =-+ case 41: //Punctuation =-+
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-. return MACRO(T(DOT), T(MINS), T(DOT), T(MINS), T(DOT), T(SPACE), END); //.-.-.
} }
else { else {
@ -797,8 +679,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 42: //Punctuation --_ case 42: //Punctuation --_
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { if (mc_shift_on == true) {
clear_mods();
return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.- return MACRO(T(DOT), T(DOT), T(MINS), T(MINS), T(DOT), T(MINS), T(SPACE), END); //..--.-
} }
else { else {
@ -808,9 +689,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
break; break;
case 43: //Morse Space case 43: //Morse Space
if (record->event.pressed) { if (record->event.pressed) {
if (keyboard_report->mods & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) {
clear_mods();
}
return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse return MACRO(T(BSLS), T(SPACE), END); //When pressed, this sends a slash followed by a space, making it easier to distinguish words in Morse
} }
break; break;
@ -833,6 +711,14 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) {
} }
} }
break; break;
case MC_LSFT ... MC_RSFT:
if (record->event.pressed) {
mc_shift_on = true;
}
else {
mc_shift_on = false;
}
break;
} }
return true; return true;
} }

Loading…
Cancel
Save