aboutsummaryrefslogtreecommitdiff
path: root/keyboards/space_space/rev1/keymaps/big_space/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/space_space/rev1/keymaps/big_space/keymap.c')
-rw-r--r--keyboards/space_space/rev1/keymaps/big_space/keymap.c130
1 files changed, 130 insertions, 0 deletions
diff --git a/keyboards/space_space/rev1/keymaps/big_space/keymap.c b/keyboards/space_space/rev1/keymaps/big_space/keymap.c
new file mode 100644
index 000000000..62241532e
--- /dev/null
+++ b/keyboards/space_space/rev1/keymaps/big_space/keymap.c
@@ -0,0 +1,130 @@
1/* Copyright 2020 qpockets
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18enum layers{
19 _BASE,
20 _SYM,
21 _NUM,
22 _NAV
23};
24
25enum combo_events {
26 COMBO_BSPC,
27 COMBO_ENT,
28 COMBO_TAB,
29 COMBO_ESC,
30 COMBO_DEL
31};
32#define KC_UP_SPC LT(_SYM, KC_SPC)
33#define KC_GZ LGUI_T(KC_Z)
34#define KC_AA LALT_T(KC_A)
35#define KC_CC LCTL_T(KC_C)
36#define KC_SF LSFT_T(KC_F)
37#define KC_SJ RSFT_T(KC_J)
38#define KC_CCOMM RCTL_T(KC_COMM)
39#define KC_AQUOT RALT_T(KC_QUOT)
40#define KC_GSLSH RGUI_T(KC_SLSH)
41
42const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
43 [_BASE] = LAYOUT_big_space(
44 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P,
45 KC_AA, KC_S, KC_D, KC_SF, KC_G, KC_BSPC, KC_H, KC_SJ, KC_K, KC_L, KC_AQUOT,
46 KC_GZ, KC_X, KC_CC, KC_V, KC_B, KC_LSFT, KC_N, KC_M, KC_CCOMM, KC_DOT, KC_GSLSH,
47 MO(_NAV), KC_UP_SPC, KC_RALT
48 ),
49
50 [_SYM] = LAYOUT_big_space(
51 KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0,
52 KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_EQUAL, KC_MINS,
53 KC_PIPE, KC_BSLS, KC_LPRN, KC_LBRC, KC_SCLN, KC_TRNS, KC_COLN, KC_RBRC, KC_RPRN, KC_PLUS, KC_UNDS,
54 KC_TRNS, KC_TRNS, KC_TRNS
55 ),
56
57 [_NAV] = LAYOUT_big_space(
58 KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC,
59 KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB,
60 KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_ENT,
61 KC_TRNS, KC_TRNS, KC_TRNS
62 ),
63};
64
65bool encoder_update_user(uint8_t index, bool clockwise) {
66 if (index == 1) { /* left encoder*/
67 switch(get_highest_layer(layer_state)){
68
69 case _NAV:
70 if (clockwise) {
71 tap_code16(C(KC_TAB));
72 } else {
73 tap_code16(C(S(KC_TAB)));
74 }
75 break;
76
77 case _SYM:
78 if (clockwise) {
79 tap_code(KC_PGUP);
80 } else {
81 tap_code(KC_PGDN);
82
83 }
84 break;
85
86 default:
87 if (clockwise){
88 tap_code(KC_WH_U);
89 } else{
90 tap_code(KC_WH_D);
91 }
92 break;
93 }
94 } else if (index == 0) { /* right encoder */
95 switch(get_highest_layer(layer_state)){
96 case _SYM:
97 if (clockwise) {
98 tap_code(KC_MPRV);
99 } else {
100 tap_code(KC_MNXT);
101 }
102 break;
103
104 default:
105 if (clockwise){
106 tap_code(KC_VOLU);
107 } else{
108 tap_code(KC_VOLD);
109 }
110 break;
111 }
112 }
113 return true;
114}
115
116#ifdef COMBO_ENABLE
117const uint16_t PROGMEM combo_bspc[] = {KC_O, KC_P, COMBO_END};
118const uint16_t PROGMEM combo_ent[] = {KC_K, KC_L, COMBO_END};
119const uint16_t PROGMEM combo_tab[] = {KC_S, KC_D, COMBO_END};
120const uint16_t PROGMEM combo_esc[] = {KC_T, KC_Y, COMBO_END};
121const uint16_t PROGMEM combo_del[] = {KC_Q, KC_W, COMBO_END};
122
123combo_t key_combos[COMBO_COUNT] = {
124 [COMBO_BSPC] = COMBO(combo_bspc,KC_BSPC),
125 [COMBO_ENT] = COMBO(combo_ent,KC_ENT),
126 [COMBO_TAB] = COMBO(combo_tab,KC_TAB),
127 [COMBO_ESC] = COMBO(combo_esc,KC_ESC),
128 [COMBO_DEL] = COMBO(combo_del,KC_DEL)
129};
130#endif