diff options
Diffstat (limited to 'layouts/community/ergodox/algernon/keymap.c')
-rw-r--r-- | layouts/community/ergodox/algernon/keymap.c | 124 |
1 files changed, 105 insertions, 19 deletions
diff --git a/layouts/community/ergodox/algernon/keymap.c b/layouts/community/ergodox/algernon/keymap.c index 8be54986f8..ebdc4ab4e4 100644 --- a/layouts/community/ergodox/algernon/keymap.c +++ b/layouts/community/ergodox/algernon/keymap.c @@ -36,11 +36,14 @@ enum { A_MPN, // Application select keys - APP_SLK, // Slack + APP_SLK, // Slack APP_EMCS, // Emacs APP_TERM, // Terminal APP_CHRM, // Chrome APP_MSIC, // Music + APP_SOCL, // Social + APP_PMGR, // Password manager + APP_SCL2, // Social #2 // Hungarian layer keys HU_AA, // Á @@ -252,7 +255,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 3: Application select layer * * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | + * | |Music |Slack |Emacs |Term |Chrome| | | |Social|PWMgr |Scl2 | | | | * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| * | | | | | | | | | | | | | | | | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| @@ -283,16 +286,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + // right hand + ,KC_TRNS ,M(APP_SOCL) ,M(APP_PMGR) ,M(APP_SCL2) ,KC_NO ,KC_NO ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ), @@ -376,8 +379,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand ,KC_TRNS ,KC_F10 ,KC_F2 ,KC_F4 ,KC_F6 ,KC_F8 ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_UP ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO @@ -536,10 +539,10 @@ static void ang_handle_num_row(uint8_t id, keyrecord_t *record) { kc = KC_8; break; case A_3: - kc = KC_6; + kc = KC_4; break; case A_1: - kc = KC_4; + kc = KC_6; break; case A_0: @@ -630,10 +633,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { register_code (KC_LGUI); if (record->tap.count && !record->tap.interrupted) { - if (record->tap.count >= 2) { + if (record->tap.count == 2) { uprintf("CMD:appsel_start\n"); layer_on (APPSEL); set_oneshot_layer (APPSEL, ONESHOT_START); + } else if (record->tap.count >= 3) { + uprintf("CMD:appsel_helper\n"); + layer_off (APPSEL); + clear_oneshot_layer_state (ONESHOT_PRESSED); } } else { record->tap.count = 0; @@ -673,6 +680,21 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) uprintf("CMD:appsel_music\n"); break; + case APP_SOCL: + if (record->event.pressed) + uprintf("CMD:appsel_social\n"); + break; + + case APP_PMGR: + if (record->event.pressed) + uprintf("CMD:appsel_pwmgr\n"); + break; + + case APP_SCL2: + if (record->event.pressed) + uprintf("CMD:appsel_social2\n"); + break; + // number row and symbols case A_1 ... A_0: ang_handle_num_row(id, record); @@ -844,14 +866,53 @@ _td_sr_reset (qk_tap_dance_state_t *state, void *user_data) { } } +static void +_td_brackets_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (state->keycode == TD(CT_LBP)) + register_code16 (KC_LBRC); + else + register_code16 (KC_RBRC); + } else if (state->count == 2) { + if (state->keycode == TD(CT_LBP)) + register_code16 (KC_LPRN); + else + register_code16 (KC_RPRN); + } else if (state->count == 3) { + unicode_input_start(); + + if (state->keycode == TD(CT_LBP)) + register_hex (0x300c); + else + register_hex (0x300d); + + unicode_input_finish(); + } +} + +static void +_td_brackets_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + if (state->keycode == TD(CT_LBP)) + unregister_code16 (KC_LBRC); + else + unregister_code16 (KC_RBRC); + } else if (state->count == 2) { + if (state->keycode == TD(CT_LBP)) + unregister_code16 (KC_LPRN); + else + unregister_code16 (KC_RPRN); + } +} + qk_tap_dance_action_t tap_dance_actions[] = { [CT_CLN] = ACTION_TAP_DANCE_DOUBLE (KC_COLN, KC_SCLN) ,[CT_TA] = { .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, .user_data = (void *)&((td_ta_state_t) { false, false }) } - ,[CT_LBP] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, KC_LPRN) - ,[CT_RBP] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, KC_RPRN) + ,[CT_LBP] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, _td_brackets_finished, _td_brackets_reset) + ,[CT_RBP] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, _td_brackets_finished, _td_brackets_reset) ,[CT_TMUX]= ACTION_TAP_DANCE_FN (ang_tap_dance_tmux_finished) ,[CT_TPS] = ACTION_TAP_DANCE_FN (ang_tap_dance_tmux_pane_select) ,[CT_SR] = ACTION_TAP_DANCE_FN_ADVANCED (_td_sr_each, _td_sr_finished, _td_sr_reset) @@ -934,6 +995,29 @@ void matrix_scan_user(void) { KC_S, KC_Z, KC_O, KC_N, KC_Y, KC_K, KC_RALT, KC_QUOT, KC_A, KC_M, 0); } + SEQ_ONE_KEY (KC_K) { + ang_tap (KC_SPC, LSFT(KC_7), KC_SPC, 0); + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + ang_tap (KC_1, KC_F, KC_4, KC_7, KC_6, 0); + register_code (KC_ENT); + unregister_code (KC_ENT); + ang_tap (KC_END, 0); + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + ang_tap (KC_1, KC_F, KC_4, KC_7, KC_6, 0); + register_code (KC_SPC); + unregister_code (KC_SPC); + } + SEQ_ONE_KEY (KC_G) { ang_tap (LSFT(KC_G), KC_E, KC_J, KC_G, KC_RALT, KC_EQL, KC_O, KC_RALT, KC_EQL, KC_O, @@ -1040,7 +1124,9 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE UCIS_SYM("pi", 0x03c0), UCIS_SYM("mouse", 0x1f401), UCIS_SYM("micro", 0x00b5), - UCIS_SYM("tm", 0x2122) + UCIS_SYM("tm", 0x2122), + UCIS_SYM("child", 0x1f476), + UCIS_SYM("family", 0x1F46A) ); bool process_record_user (uint16_t keycode, keyrecord_t *record) { |