diff options
| author | Konstantin Đorđević <vomindoraan@gmail.com> | 2019-01-28 09:04:47 +0100 |
|---|---|---|
| committer | Konstantin Đorđević <vomindoraan@gmail.com> | 2019-03-02 15:15:51 +0100 |
| commit | 6f386ca6ae82be9212700dbfeb73517d077bef5a (patch) | |
| tree | a8b14097f72224c92a83c94dd835c1e9a7887007 /users/konstantin | |
| parent | 6e48ea082dc27ac25bd0422e974cefe7a00788f6 (diff) | |
| download | qmk_firmware-6f386ca6ae82be9212700dbfeb73517d077bef5a.tar.gz qmk_firmware-6f386ca6ae82be9212700dbfeb73517d077bef5a.zip | |
Change how desktop commands work
Diffstat (limited to 'users/konstantin')
| -rw-r--r-- | users/konstantin/konstantin.c | 12 | ||||
| -rw-r--r-- | users/konstantin/konstantin.h | 7 | ||||
| -rw-r--r-- | users/konstantin/tap_dance.c | 2 | ||||
| -rw-r--r-- | users/konstantin/tap_dance.h | 6 |
4 files changed, 22 insertions, 5 deletions
diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index 47596279c..bf92a503e 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) { | |||
| 28 | } | 28 | } |
| 29 | return false; | 29 | return false; |
| 30 | 30 | ||
| 31 | case DST_P_R: | ||
| 32 | (record->event.pressed ? register_code16 : unregister_code16)( | ||
| 33 | (get_mods() & MOD_MASK_CTRL) ? DST_RMV : DST_PRV | ||
| 34 | ); | ||
| 35 | return false; | ||
| 36 | |||
| 37 | case DST_N_A: | ||
| 38 | (record->event.pressed ? register_code16 : unregister_code16)( | ||
| 39 | (get_mods() & MOD_MASK_CTRL) ? DST_ADD : DST_NXT | ||
| 40 | ); | ||
| 41 | return false; | ||
| 42 | |||
| 31 | #ifdef LAYER_FN | 43 | #ifdef LAYER_FN |
| 32 | static bool fn_lock; | 44 | static bool fn_lock; |
| 33 | 45 | ||
diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h index f67f9f1b7..3ca4f401e 100644 --- a/users/konstantin/konstantin.h +++ b/users/konstantin/konstantin.h | |||
| @@ -23,6 +23,11 @@ | |||
| 23 | #define PRV_TAB LCTL(KC_PGUP) | 23 | #define PRV_TAB LCTL(KC_PGUP) |
| 24 | #define NXT_TAB LCTL(KC_PGDN) | 24 | #define NXT_TAB LCTL(KC_PGDN) |
| 25 | 25 | ||
| 26 | #define DST_ADD LCTL(LGUI(KC_D)) | ||
| 27 | #define DST_RMV LCTL(LGUI(KC_F4)) | ||
| 28 | #define DST_PRV LCTL(LGUI(KC_LEFT)) | ||
| 29 | #define DST_NXT LCTL(LGUI(KC_RGHT)) | ||
| 30 | |||
| 26 | #define LCT_CPS LCTL_T(KC_CAPS) | 31 | #define LCT_CPS LCTL_T(KC_CAPS) |
| 27 | 32 | ||
| 28 | #ifdef SEND_STRING_CLEAN | 33 | #ifdef SEND_STRING_CLEAN |
| @@ -37,6 +42,8 @@ | |||
| 37 | 42 | ||
| 38 | enum keycodes_user { | 43 | enum keycodes_user { |
| 39 | CLEAR = SAFE_RANGE, | 44 | CLEAR = SAFE_RANGE, |
| 45 | DST_P_R, | ||
| 46 | DST_N_A, | ||
| 40 | #ifdef LAYER_NUMPAD | 47 | #ifdef LAYER_NUMPAD |
| 41 | NUMPAD, | 48 | NUMPAD, |
| 42 | #endif | 49 | #endif |
diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c index b13f33c02..e3f172946 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) { | |||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | qk_tap_dance_action_t tap_dance_actions[] = { | 84 | qk_tap_dance_action_t tap_dance_actions[] = { |
| 85 | [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop | 85 | [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_RMV), |
| 86 | 86 | ||
| 87 | [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_LALT), | 87 | [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_LALT), |
| 88 | [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_RGUI), | 88 | [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 922a63514..1757e9b11 100644 --- a/users/konstantin/tap_dance.h +++ b/users/konstantin/tap_dance.h | |||
| @@ -2,9 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | #include "quantum.h" | 3 | #include "quantum.h" |
| 4 | 4 | ||
| 5 | #define DESKTOP TD(TD_DESKTOP) | 5 | #define DST_A_R TD(TD_DST_A_R) |
| 6 | #define DSKTP_L LCTL(LGUI(KC_LEFT)) | ||
| 7 | #define DSKTP_R LCTL(LGUI(KC_RGHT)) | ||
| 8 | 6 | ||
| 9 | #define RAL_LAL TD(TD_RAL_LAL) | 7 | #define RAL_LAL TD(TD_RAL_LAL) |
| 10 | #define RAL_RGU TD(TD_RAL_RGU) | 8 | #define RAL_RGU TD(TD_RAL_RGU) |
| @@ -14,7 +12,7 @@ | |||
| 14 | #define LSFT_FN TD(TD_LSFT_FN) | 12 | #define LSFT_FN TD(TD_LSFT_FN) |
| 15 | 13 | ||
| 16 | enum tap_dance { | 14 | enum tap_dance { |
| 17 | TD_DESKTOP, | 15 | TD_DST_A_R, |
| 18 | 16 | ||
| 19 | TD_RAL_LAL, | 17 | TD_RAL_LAL, |
| 20 | TD_RAL_RGU, | 18 | TD_RAL_RGU, |
