diff options
Diffstat (limited to 'keyboards/knops')
-rw-r--r-- | keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c | 109 | ||||
-rw-r--r-- | keyboards/knops/mini/keymaps/default/keymap.c | 71 |
2 files changed, 40 insertions, 140 deletions
diff --git a/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c b/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c index e35b8ec080..68c96fc192 100644 --- a/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c +++ b/keyboards/knops/mini/keymaps/default-gsm-newbs/keymap.c @@ -1,5 +1,10 @@ #include QMK_KEYBOARD_H +enum custom_keycodes { + M_TGLHF = SAFE_RANGE, + M_TGG +}; + /* * Copy of knopps mini default May 16,2018 * Added comments in code to more easilly understand it. @@ -41,16 +46,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * Layer 1 * _____ _____ _____ * | | | | | | -* ESC Macro3 Macro4 +* ESC Ctl+Z CSf+Z * |_____| |_____| |_____| * _____ _____ _____ * | | | | | | -* Macro5 Macro6 Macro7 +* Ctl+X Ctl+C Ctl+V * |_____| |_____| |_____| * */ LAYOUT( - LT(3, KC_ESC), M(3), M(4), M(5), M(6), M(7)), + LT(3, KC_ESC), C(KC_Z), C(S(KC_Z)), C(KC_X), C(KC_C), C(KC_V)), /* * Layer 2 @@ -65,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * */ LAYOUT( - LT(3, KC_1), KC_2, KC_3, KC_4, M(0), M(1)), + LT(3, KC_1), KC_2, KC_3, KC_4, M_TGLHF, M_TGG), /* * Layer 3 Key Layout @@ -126,91 +131,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -// Older way of Macros found here: https://docs.qmk.fm/features/macros - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - //keyevent_t event = record->event; - - switch (id) { - case 0: - if (record->event.pressed) { - /* - * This is Macro 0 - * Content: tglhf<enter> - */ - return MACRO( T(T), T(G), T(L), T(H), T(F), T(ENT), END ); - } - break; - case 1: - if (record->event.pressed) { - /* - * This is Macro 1 - * Content: tgg<enter> - */ - return MACRO( T(T), T(G), T(G), T(ENT), END ); - } - break; - case 2: - if (record->event.pressed) { - /* - * This is Macro 2 - * Content: Press and hold "no" , type "l", release "no"<enter> - * I haven't found what this "NO" key maps to - */ - return MACRO( D(NO), T(L), U(NO), END ); - } - break; - case 3: - if (record->event.pressed) { - /* - * This is Macro 3 - * Content: press/hold LCTRL, type "2", release LCTRL - */ - return MACRO( D(LCTL), T(Z), U(LCTL), END ); - } - break; - case 4: - if (record->event.pressed) { - /* - * This is Macro 4 - * Content: press/hold LCTRL, type "2", release LCTRL - */ - return MACRO( D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END ); - } - break; - case 5: - if (record->event.pressed) { - /* - * This is Macro 5 - * Content: press/hold LCTRL, type "x", release LCTRL - */ - return MACRO( D(LCTL), T(X), U(LCTL), END ); - } - break; - case 6: - if (record->event.pressed) { - /* - * This is Macro 6 - * Content: press/hold LCTRL, type "c", release LCTRL - */ - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } - break; - case 7: - if (record->event.pressed) { - /* - * This is Macro 7 - * Content: press/hold LCTRL, type "v", release LCTRL - */ - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - break; - } - return MACRO_NONE; -} - - - void set_switch_led(int ledId, bool state) { if(state) { switch(ledId) { @@ -480,6 +400,17 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) { led_set_layer(2); } break; + case M_TGLHF: + if (record->event.pressed) { + SEND_STRING("tglhf"); + tap_code(KC_ENT); + } + case M_TGG: + if (record->event.pressed) { + SEND_STRING("tgg"); + tap_code(KC_ENT); + } + return false; } return true; } diff --git a/keyboards/knops/mini/keymaps/default/keymap.c b/keyboards/knops/mini/keymaps/default/keymap.c index a5a701c88d..859f07aa07 100644 --- a/keyboards/knops/mini/keymaps/default/keymap.c +++ b/keyboards/knops/mini/keymaps/default/keymap.c @@ -1,15 +1,20 @@ #include QMK_KEYBOARD_H +enum custom_keycodes { + M_TGLHF = SAFE_RANGE, + M_TGG +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( LT(3, KC_MSTP), KC_VOLU, KC_MPLY, KC_MPRV, KC_VOLD, KC_MNXT), LAYOUT( - LT(3, KC_ESC), M(3), M(4), M(5), M(6), M(7)), + LT(3, KC_ESC), C(KC_Z), C(S(KC_Z)), C(KC_X), C(KC_C), C(KC_V)), LAYOUT( - LT(3, KC_1), KC_2, KC_3, KC_4, M(0), M(1)), + LT(3, KC_1), KC_2, KC_3, KC_4, M_TGLHF, M_TGG), LAYOUT( KC_TRNS, KC_TRNS, RESET, TO(0), TO(1), TO(2)), @@ -52,54 +57,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - //keyevent_t event = record->event; - - switch (id) { - case 0: - if (record->event.pressed) { - return MACRO( T(T), T(G), T(L), T(H), T(F), T(ENT), END ); - } - break; - case 1: - if (record->event.pressed) { - return MACRO( T(T), T(G), T(G), T(ENT), END ); - } - break; - case 2: - if (record->event.pressed) { - return MACRO( D(NO), T(L), U(NO), END ); - } - break; - case 3: - if (record->event.pressed) { - return MACRO( D(LCTL), T(Z), U(LCTL), END ); - } - break; - case 4: - if (record->event.pressed) { - return MACRO( D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END ); - } - break; - case 5: - if (record->event.pressed) { - return MACRO( D(LCTL), T(X), U(LCTL), END ); - } - break; - case 6: - if (record->event.pressed) { - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } - break; - case 7: - if (record->event.pressed) { - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - break; - } - return MACRO_NONE; -} - void set_switch_led(int ledId, bool state) { if(state) { switch(ledId) { @@ -369,6 +326,18 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) { led_set_layer(2); } break; + case M_TGLHF: + if (record->event.pressed) { + SEND_STRING("tglhf"); + tap_code(KC_ENT); + } + return false; + case M_TGG: + if (record->event.pressed) { + SEND_STRING("tgg"); + tap_code(KC_ENT); + } + return false; } return true; -}
\ No newline at end of file +} |