diff --git a/keyboards/ergohaven/k02/keymaps/j/keymap.c b/keyboards/ergohaven/k02/keymaps/j/keymap.c index fb741c12f94..7c77eca2440 100755 --- a/keyboards/ergohaven/k02/keymaps/j/keymap.c +++ b/keyboards/ergohaven/k02/keymaps/j/keymap.c @@ -34,6 +34,12 @@ char wpm_str[4]; #define APP_C LSG(KC_C) #define APP_V LSG(KC_V) +enum custom_keycodes { + NEXTSEN = USER00, + PREDL, + BRACES, + PARENTH +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_all( @@ -324,3 +330,43 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } }; + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case NEXTSEN: // Next sentence macro. + if (record->event.pressed) { + SEND_STRING(". "); + add_oneshot_mods(MOD_BIT(KC_LSFT)); // Set one-shot mod for shift. + } + return false; + + case PREDL: // Next sentence macro. + if (record->event.pressed) { + SEND_STRING("/ "); + add_oneshot_mods(MOD_BIT(KC_LSFT)); // Set one-shot mod for shift. + } + return false; + + case BRACES: + if (record->event.pressed) { + uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); + if (shifted) { + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + SEND_STRING("{}"SS_TAP(X_LEFT)); + } + else { + SEND_STRING("[]"SS_TAP(X_LEFT)); + } + } + break; + + case PARENTH: + if (record->event.pressed) { + SEND_STRING("()"); + tap_code(KC_LEFT); + } + break; +} +} + diff --git a/keyboards/ergohaven/k02/keymaps/j/vial.json b/keyboards/ergohaven/k02/keymaps/j/vial.json index bc018625bba..49da124d30f 100755 --- a/keyboards/ergohaven/k02/keymaps/j/vial.json +++ b/keyboards/ergohaven/k02/keymaps/j/vial.json @@ -8,14 +8,24 @@ "cols": 6 }, "customKeycodes": [ - {"name": "RU_A", - "title": "A (Cyrillic)", - "shortName": "RU_A" + {"name": "NEXTSEN", + "title": "Add a dot then capitalize the first letter of a new sentence (US layout)", + "shortName": "NEXTSEN" }, - {"name": "Linux Unicode", - "title": "NICE", - "shortName": "UNIC_LIN" - } + {"name": "PREDL", + "title": "Поставить точку и начать новое предложение с заглавной буквы (Русская раскладка)", + "shortName": "PREDL" + }, + {"name": "BRACES", + "title": "This keycode types [, then ], and taps the left arrow to position the cursor between the []. Or if shift is held, it does the same but with curly braces {}.", + "shortName": "BRACES" + }, + {"name": "PARENTH", + "title": "This keycode types (, then ), and taps the left arrow to position the cursor between the ().", + "shortName": "PARENTH" + } + + ], "layouts": { "keymap":[ diff --git a/keyboards/ergohaven/k02/keymaps/vial/keymap.c b/keyboards/ergohaven/k02/keymaps/vial/keymap.c index fdd59cbcd98..6957617d9db 100755 --- a/keyboards/ergohaven/k02/keymaps/vial/keymap.c +++ b/keyboards/ergohaven/k02/keymaps/vial/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H - #include char wpm_str[4]; @@ -28,6 +27,13 @@ char wpm_str[4]; #define PREVWRD LCTL(KC_LEFT) #define NEXTWRD LCTL(KC_RIGHT) +enum custom_keycodes { + NEXTSEN = USER00, + PREDL, + BRACES, + PARENTH +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_all( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ @@ -318,3 +324,43 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } + + +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case NEXTSEN: // Next sentence macro. + if (record->event.pressed) { + SEND_STRING(". "); + add_oneshot_mods(MOD_BIT(KC_LSFT)); // Set one-shot mod for shift. + } + return false; + + case PREDL: // Next sentence macro. + if (record->event.pressed) { + SEND_STRING("/ "); + add_oneshot_mods(MOD_BIT(KC_LSFT)); // Set one-shot mod for shift. + } + return false; + + case BRACES: + if (record->event.pressed) { + uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); + if (shifted) { + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + SEND_STRING("{}"SS_TAP(X_LEFT)); + } + else { + SEND_STRING("[]"SS_TAP(X_LEFT)); + } + } + break; + + case PARENTH: + if (record->event.pressed) { + SEND_STRING("()"); + tap_code(KC_LEFT); + } + break; +} +} diff --git a/keyboards/ergohaven/k02/keymaps/vial/vial.json b/keyboards/ergohaven/k02/keymaps/vial/vial.json index 2d9b563f84d..c3abcbc479f 100755 --- a/keyboards/ergohaven/k02/keymaps/vial/vial.json +++ b/keyboards/ergohaven/k02/keymaps/vial/vial.json @@ -7,6 +7,24 @@ "rows": 10, "cols": 6 }, + "customKeycodes": [ + {"name": "NEXTSEN", + "title": "Add a dot then capitalize the first letter of a new sentence (US layout)", + "shortName": "NEXTSEN" + }, + {"name": "PREDL", + "title": "Поставить точку и начать новое предложение с заглавной буквы (Русская раскладка)", + "shortName": "PREDL" + }, + {"name": "BRACES", + "title": "This keycode types [, then ], and taps the left arrow to position the cursor between the []. Or if shift is held, it does the same but with curly braces {}.", + "shortName": "BRACES" + }, + {"name": "PARENTH", + "title": "This keycode types (, then ), and taps the left arrow to position the cursor between the ().", + "shortName": "PARENTH" + } + ], "layouts": { "keymap":[ [{"c":"#aaaaaa","x":3},"0,3",{"x":7.25},"5,2"], diff --git a/keyboards/ergohaven/remnant/keymaps/vial/keymap.c b/keyboards/ergohaven/remnant/keymaps/vial/keymap.c index 3b4cf17c580..ffe238d8544 100755 --- a/keyboards/ergohaven/remnant/keymaps/vial/keymap.c +++ b/keyboards/ergohaven/remnant/keymaps/vial/keymap.c @@ -26,6 +26,13 @@ #define PREVWRD LCTL(KC_LEFT) #define NEXTWRD LCTL(KC_RIGHT) +enum custom_keycodes { + NEXTSEN = USER00, + PREDL, + BRACES, + PARENTH +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_5x6( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, @@ -91,4 +98,41 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } +bool process_record_user(uint16_t keycode, keyrecord_t* record) { + switch (keycode) { + case NEXTSEN: // Next sentence macro. + if (record->event.pressed) { + SEND_STRING(". "); + add_oneshot_mods(MOD_BIT(KC_LSFT)); // Set one-shot mod for shift. + } + return false; + + case PREDL: // Next sentence macro. + if (record->event.pressed) { + SEND_STRING("/ "); + add_oneshot_mods(MOD_BIT(KC_LSFT)); // Set one-shot mod for shift. + } + return false; + + case BRACES: + if (record->event.pressed) { + uint8_t shifted = get_mods() & (MOD_MASK_SHIFT); + if (shifted) { + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + SEND_STRING("{}"SS_TAP(X_LEFT)); + } + else { + SEND_STRING("[]"SS_TAP(X_LEFT)); + } + } + break; + case PARENTH: + if (record->event.pressed) { + SEND_STRING("()"); + tap_code(KC_LEFT); + } + break; +} +} diff --git a/keyboards/ergohaven/remnant/keymaps/vial/vial.json b/keyboards/ergohaven/remnant/keymaps/vial/vial.json index 24160280c7c..48de2b3fe3d 100755 --- a/keyboards/ergohaven/remnant/keymaps/vial/vial.json +++ b/keyboards/ergohaven/remnant/keymaps/vial/vial.json @@ -7,6 +7,24 @@ "rows": 12, "cols": 6 }, + "customKeycodes": [ + {"name": "NEXTSEN", + "title": "Add a dot then capitalize the first letter of a new sentence (US layout)", + "shortName": "NEXTSEN" + }, + {"name": "PREDL", + "title": "Поставить точку и начать новое предложение с заглавной буквы (Русская раскладка)", + "shortName": "PREDL" + }, + {"name": "BRACES", + "title": "This keycode types [, then ], and taps the left arrow to position the cursor between the []. Or if shift is held, it does the same but with curly braces {}.", + "shortName": "BRACES" + }, + {"name": "PARENTH", + "title": "This keycode types (, then ), and taps the left arrow to position the cursor between the ().", + "shortName": "PARENTH" + } + ], "layouts": { "keymap": [