@ -26,10 +26,10 @@ enum my_keycodes {
} ;
enum td_keycodes {
ALT_ O P,
CTL_ C CB,
GUI_ C P,
SFT_ O CB,
ALT_ L P,
CTL_ R CB,
GUI_ R P,
SFT_ L CB,
SFT_PLS
} ;
@ -41,14 +41,14 @@ typedef enum {
static td_state_t td_state ;
int cur_dance ( qk_tap_dance_state_t * state ) ;
void alt o p_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void alt o p_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void ctl c cb_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void ctl c cb_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void gui c p_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void gui c p_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void sft o cb_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void sft o cb_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void alt l p_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void alt l p_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void ctl r cb_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void ctl r cb_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void gui r p_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void gui r p_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void sft l cb_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void sft l cb_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
void sftpls_finished ( qk_tap_dance_state_t * state , void * user_data ) ;
void sftpls_reset ( qk_tap_dance_state_t * state , void * user_data ) ;
@ -58,7 +58,7 @@ void sftpls_reset (qk_tap_dance_state_t *state, void *user_data);
# define ALT_D LALT_T(KC_D)
# define ALT_E LALT_T(KC_E)
# define ALT_K LALT_T(KC_K)
# define ALT_ O B LALT_T(KC_LBRC)
# define ALT_ L B LALT_T(KC_LBRC)
# define ALT_S LALT_T(KC_S)
# define CTRL_2 LCTL_T(KC_2)
# define CTRL_4 LCTL_T(KC_4)
@ -73,7 +73,7 @@ void sftpls_reset (qk_tap_dance_state_t *state, void *user_data);
# define GUI_1 LGUI_T(KC_1)
# define GUI_4 LGUI_T(KC_4)
# define GUI_7 LGUI_T(KC_7)
# define GUI_ C B LGUI_T(KC_RBRC)
# define GUI_ R B LGUI_T(KC_RBRC)
# define GUI_F LGUI_T(KC_F)
# define GUI_J LGUI_T(KC_J)
# define GUI_N LGUI_T(KC_N)
@ -252,7 +252,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[ _SYM ] = LAYOUT ( \
KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , KC_QUES , KC_QUOT , \
TD ( SFT_PLS ) , CTRL_EQ , TD ( ALT_ OP) , TD ( GUI_CP ) , KC_DQT , KC_COLN , GUI_CB , ALT_OB , TD ( CTL_CCB ) , TD ( SFT_O CB) , \
TD ( SFT_PLS ) , CTRL_EQ , TD ( ALT_ LP) , TD ( GUI_RP ) , KC_DQT , KC_COLN , GUI_RB , ALT_LB , TD ( CTL_RCB ) , TD ( SFT_L CB) , \
KC_LT , KC_PIPE , KC_MINS , KC_GT , KC_BSLS , KC_GRV , KC_UNDS , KC_SLSH , KC_TILD , KC_SCLN , \
_______ , MAC_EN , _______ , _______ , MAC_EM , _______ \
)
@ -285,131 +285,115 @@ int cur_dance (qk_tap_dance_state_t *state) {
else return 3 ;
}
void alt o p_finished ( qk_tap_dance_state_t * state , void * user_data ) {
void alt l p_finished ( qk_tap_dance_state_t * state , void * user_data ) {
td_state = cur_dance ( state ) ;
switch ( td_state ) {
case SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
register_code ( KC_9 ) ;
register_code16 ( KC_LPRN ) ;
break ;
case SINGLE_HOLD :
register_mods ( MOD_BIT ( KC_LALT ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
tap_code ( KC_9 ) ;
register_code ( KC_9 ) ;
tap_code16 ( KC_LPRN ) ;
register_code16 ( KC_LPRN ) ;
}
}
void alt o p_reset ( qk_tap_dance_state_t * state , void * user_data ) {
void alt l p_reset ( qk_tap_dance_state_t * state , void * user_data ) {
switch ( td_state ) {
case SINGLE_TAP :
unregister_code ( KC_9 ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_LPRN ) ;
break ;
case SINGLE_HOLD :
unregister_mods ( MOD_BIT ( KC_LALT ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
unregister_code ( KC_9 ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_LPRN ) ;
}
}
void ctl c cb_finished ( qk_tap_dance_state_t * state , void * user_data ) {
void ctl r cb_finished ( qk_tap_dance_state_t * state , void * user_data ) {
td_state = cur_dance ( state ) ;
switch ( td_state ) {
case SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
register_code ( KC_RBRC ) ;
register_code16 ( KC_RCBR ) ;
break ;
case SINGLE_HOLD :
register_mods ( MOD_BIT ( KC_LCTL ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
tap_code ( KC_RBRC ) ;
register_code ( KC_RBRC ) ;
tap_code16 ( KC_RCBR ) ;
register_code16 ( KC_RCBR ) ;
}
}
void ctl c cb_reset ( qk_tap_dance_state_t * state , void * user_data ) {
void ctl r cb_reset ( qk_tap_dance_state_t * state , void * user_data ) {
switch ( td_state ) {
case SINGLE_TAP :
unregister_code ( KC_RBRC ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_RCBR ) ;
break ;
case SINGLE_HOLD :
unregister_mods ( MOD_BIT ( KC_LCTL ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
unregister_code ( KC_RBRC ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_RCBR ) ;
}
}
void gui c p_finished ( qk_tap_dance_state_t * state , void * user_data ) {
void gui r p_finished ( qk_tap_dance_state_t * state , void * user_data ) {
td_state = cur_dance ( state ) ;
switch ( td_state ) {
case SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
register_code ( KC_0 ) ;
register_code16 ( KC_RPRN ) ;
break ;
case SINGLE_HOLD :
register_mods ( MOD_BIT ( KC_LGUI ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
tap_code ( KC_0 ) ;
register_code ( KC_0 ) ;
tap_code16 ( KC_RPRN ) ;
register_code16 ( KC_RPRN ) ;
}
}
void gui c p_reset ( qk_tap_dance_state_t * state , void * user_data ) {
void gui r p_reset ( qk_tap_dance_state_t * state , void * user_data ) {
switch ( td_state ) {
case SINGLE_TAP :
unregister_code ( KC_0 ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_RPRN ) ;
break ;
case SINGLE_HOLD :
unregister_mods ( MOD_BIT ( KC_LGUI ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
unregister_code ( KC_0 ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_RPRN ) ;
}
}
void sft o cb_finished ( qk_tap_dance_state_t * state , void * user_data ) {
void sft l cb_finished ( qk_tap_dance_state_t * state , void * user_data ) {
td_state = cur_dance ( state ) ;
switch ( td_state ) {
case SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
register_code ( KC_LBRC ) ;
register_code16 ( KC_LCBR ) ;
break ;
case SINGLE_HOLD :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
tap_code ( KC_LBRC ) ;
register_code ( KC_LBRC ) ;
tap_code16 ( KC_LCBR ) ;
register_code16 ( KC_LCBR ) ;
}
}
void sft o cb_reset ( qk_tap_dance_state_t * state , void * user_data ) {
void sft l cb_reset ( qk_tap_dance_state_t * state , void * user_data ) {
switch ( td_state ) {
case SINGLE_TAP :
unregister_code ( KC_LBRC ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_LCBR ) ;
break ;
case SINGLE_HOLD :
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
unregister_code ( KC_LBRC ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_LCBR ) ;
}
}
@ -417,38 +401,34 @@ void sftpls_finished (qk_tap_dance_state_t *state, void *user_data) {
td_state = cur_dance ( state ) ;
switch ( td_state ) {
case SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
register_code ( KC_EQL ) ;
register_code16 ( KC_PLUS ) ;
break ;
case SINGLE_HOLD :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
register_mods ( MOD_BIT ( KC_LSFT ) ) ;
tap_code ( KC_EQL ) ;
register_code ( KC_EQL ) ;
tap_code16 ( KC_PLUS ) ;
register_code16 ( KC_PLUS ) ;
}
}
void sftpls_reset ( qk_tap_dance_state_t * state , void * user_data ) {
switch ( td_state ) {
case SINGLE_TAP :
unregister_code ( KC_EQL ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_PLUS ) ;
break ;
case SINGLE_HOLD :
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
break ;
case DOUBLE_SINGLE_TAP :
unregister_code ( KC_EQL ) ;
unregister_mods ( MOD_BIT ( KC_LSFT ) ) ;
unregister_code16 ( KC_PLUS ) ;
}
}
qk_tap_dance_action_t tap_dance_actions [ ] = {
[ ALT_ OP] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , altop_finished , alto p_reset) ,
[ CTL_ C CB] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , ctl ccb_finished, ctlc cb_reset) ,
[ GUI_ CP] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , guicp_finished , guic p_reset) ,
[ SFT_ O CB] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , sft ocb_finished, sfto cb_reset) ,
[ ALT_ LP] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , altlp_finished , altl p_reset) ,
[ CTL_ R CB] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , ctl rcb_finished, ctlr cb_reset) ,
[ GUI_ RP] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , guirp_finished , guir p_reset) ,
[ SFT_ L CB] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , sft lcb_finished, sftl cb_reset) ,
[ SFT_PLS ] = ACTION_TAP_DANCE_FN_ADVANCED ( NULL , sftpls_finished , sftpls_reset )
} ;