From 6f386ca6ae82be9212700dbfeb73517d077bef5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Mon, 28 Jan 2019 09:04:47 +0100 Subject: Change how desktop commands work --- users/konstantin/konstantin.c | 12 ++++++++++++ users/konstantin/konstantin.h | 7 +++++++ users/konstantin/tap_dance.c | 2 +- users/konstantin/tap_dance.h | 6 ++---- 4 files changed, 22 insertions(+), 5 deletions(-) (limited to 'users/konstantin') diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index 47596279c3..bf92a503e6 100644 --- a/users/konstantin/konstantin.c +++ b/users/konstantin/konstantin.c @@ -28,6 +28,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; + case DST_P_R: + (record->event.pressed ? register_code16 : unregister_code16)( + (get_mods() & MOD_MASK_CTRL) ? DST_RMV : DST_PRV + ); + return false; + + case DST_N_A: + (record->event.pressed ? register_code16 : unregister_code16)( + (get_mods() & MOD_MASK_CTRL) ? DST_ADD : DST_NXT + ); + return false; + #ifdef LAYER_FN static bool fn_lock; diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h index f67f9f1b7e..3ca4f401e0 100644 --- a/users/konstantin/konstantin.h +++ b/users/konstantin/konstantin.h @@ -23,6 +23,11 @@ #define PRV_TAB LCTL(KC_PGUP) #define NXT_TAB LCTL(KC_PGDN) +#define DST_ADD LCTL(LGUI(KC_D)) +#define DST_RMV LCTL(LGUI(KC_F4)) +#define DST_PRV LCTL(LGUI(KC_LEFT)) +#define DST_NXT LCTL(LGUI(KC_RGHT)) + #define LCT_CPS LCTL_T(KC_CAPS) #ifdef SEND_STRING_CLEAN @@ -37,6 +42,8 @@ enum keycodes_user { CLEAR = SAFE_RANGE, + DST_P_R, + DST_N_A, #ifdef LAYER_NUMPAD NUMPAD, #endif diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c index b13f33c024..e3f1729467 100644 --- a/users/konstantin/tap_dance.c +++ b/users/konstantin/tap_dance.c @@ -82,7 +82,7 @@ void td_lsft_fn_reset(qk_tap_dance_state_t *state, void *user_data) { } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop + [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_RMV), [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_LALT), [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_RGUI), diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h index 922a635141..1757e9b113 100644 --- a/users/konstantin/tap_dance.h +++ b/users/konstantin/tap_dance.h @@ -2,9 +2,7 @@ #include "quantum.h" -#define DESKTOP TD(TD_DESKTOP) -#define DSKTP_L LCTL(LGUI(KC_LEFT)) -#define DSKTP_R LCTL(LGUI(KC_RGHT)) +#define DST_A_R TD(TD_DST_A_R) #define RAL_LAL TD(TD_RAL_LAL) #define RAL_RGU TD(TD_RAL_RGU) @@ -14,7 +12,7 @@ #define LSFT_FN TD(TD_LSFT_FN) enum tap_dance { - TD_DESKTOP, + TD_DST_A_R, TD_RAL_LAL, TD_RAL_RGU, -- cgit v1.2.1