aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2019-01-28 09:04:47 +0100
committerKonstantin Đorđević <vomindoraan@gmail.com>2019-03-02 15:15:51 +0100
commit6f386ca6ae82be9212700dbfeb73517d077bef5a (patch)
treea8b14097f72224c92a83c94dd835c1e9a7887007
parent6e48ea082dc27ac25bd0422e974cefe7a00788f6 (diff)
downloadqmk_firmware-6f386ca6ae82be9212700dbfeb73517d077bef5a.tar.gz
qmk_firmware-6f386ca6ae82be9212700dbfeb73517d077bef5a.zip
Change how desktop commands work
-rw-r--r--keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c8
-rw-r--r--keyboards/whitefox/keymaps/konstantin/keymap.c4
-rw-r--r--users/konstantin/konstantin.c12
-rw-r--r--users/konstantin/konstantin.h7
-rw-r--r--users/konstantin/tap_dance.c2
-rw-r--r--users/konstantin/tap_dance.h6
6 files changed, 28 insertions, 11 deletions
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
index fa324be9a..707515abb 100644
--- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
+++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
@@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
58 * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ 58 * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤
59 * │ │Mut│VoD│VoU│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │ 59 * │ │Mut│VoD│VoU│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │
60 * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ 60 * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘
61 * │ │ MW↓ │MAcl2│ │ 61 * │DPRDstNA│ MW↓ │MAcl2│ │
62 * └───┴─────┴───────────────────────────┴─────┴───┘ 62 * └───┴─────┴───────────────────────────┴─────┴───┘
63 */ 63 */
64 [L_FN] = LAYOUT( 64 [L_FN] = LAYOUT(
@@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
66 _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_DEL, 66 _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_DEL,
67 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, 67 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______,
68 _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______, 68 _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______,
69 XXXXXXX, _______, _______, KC_WH_D, KC_ACL2, _______, XXXXXXX 69 XXXXXXX, DST_P_R, DST_N_A, KC_WH_D, KC_ACL2, _______, XXXXXXX
70 ), 70 ),
71 71
72 /* RCtrl layer 72 /* RCtrl layer
@@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
79 * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ 79 * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤
80 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ 80 * │ │ │ │ │ │ │ │ │ │ │ │ │ │
81 * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ 81 * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘
82 * │Dst│DstpDstp 82 * │DtR│DstA │ │ │ │
83 * └───┴─────┴───────────────────────────┴─────┴───┘ 83 * └───┴─────┴───────────────────────────┴─────┴───┘
84 */ 84 */
85 [L_RCTRL] = LAYOUT( 85 [L_RCTRL] = LAYOUT(
@@ -87,6 +87,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
87 _______, TOP, MV_UP, BOTTOM, PRV_TAB, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR, 87 _______, TOP, MV_UP, BOTTOM, PRV_TAB, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR,
88 _______, MV_LEFT, MV_DOWN, MV_RGHT, NXT_TAB, _______, _______, _______, _______, _______, _______, _______, _______, 88 _______, MV_LEFT, MV_DOWN, MV_RGHT, NXT_TAB, _______, _______, _______, _______, _______, _______, _______, _______,
89 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, 89 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
90 XXXXXXX, DESKTOP, DSKTP_L, _______, DSKTP_R, _______, XXXXXXX 90 XXXXXXX, DST_RMV, DST_ADD, _______, _______, _______, XXXXXXX
91 ), 91 ),
92}; 92};
diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c
index e37097361..a56d0a43e 100644
--- a/keyboards/whitefox/keymaps/konstantin/keymap.c
+++ b/keyboards/whitefox/keymaps/konstantin/keymap.c
@@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33 * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ 33 * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
34 * │ │MA0│MA2│MW←│MW→│ │ │ │VoD│VoU│Mut│ App │PgU│Btm│ 34 * │ │MA0│MA2│MW←│MW→│ │ │ │VoD│VoU│Mut│ App │PgU│Btm│
35 * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ 35 * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
36 * │ │Dstp│Dst MW↓ │Dst │ │Hom│PgD│End│ 36 * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│
37 * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ 37 * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
38 */ 38 */
39 [L_FN] = LAYOUT_truefox( \ 39 [L_FN] = LAYOUT_truefox( \
@@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41 KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ 41 KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \
42 _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, \ 42 _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, \
43 _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \ 43 _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \
44 _______, DESKTOP, DSKTP_L, KC_WH_D, DSKTP_R, _______, KC_HOME, KC_PGDN, KC_END \ 44 _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END \
45 ), 45 ),
46 46
47 /* Numpad layer 47 /* Numpad layer
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
38enum keycodes_user { 43enum 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
84qk_tap_dance_action_t tap_dance_actions[] = { 84qk_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
16enum tap_dance { 14enum 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,