aboutsummaryrefslogtreecommitdiff
path: root/keyboards/delikeeb/vaguettelite/keymaps/noclew/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/delikeeb/vaguettelite/keymaps/noclew/keymap.c')
-rw-r--r--keyboards/delikeeb/vaguettelite/keymaps/noclew/keymap.c154
1 files changed, 154 insertions, 0 deletions
diff --git a/keyboards/delikeeb/vaguettelite/keymaps/noclew/keymap.c b/keyboards/delikeeb/vaguettelite/keymaps/noclew/keymap.c
new file mode 100644
index 000000000..d8f470288
--- /dev/null
+++ b/keyboards/delikeeb/vaguettelite/keymaps/noclew/keymap.c
@@ -0,0 +1,154 @@
1/* Copyright 2020 noclew
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
18// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _LOWER,
22 _RAISE,
23 _ADJUST,
24 _MAC,
25 _GAME
26};
27
28// Defines the keycodes used by our macros in process_record_user
29enum custom_keycodes {
30 BASE = SAFE_RANGE,
31 LOWER,
32 RAISE,
33 MAC,
34 GAME
35};
36
37const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
38
39 /* BASE
40 * ---------------------------------------------------------------------------------------------------------
41 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bspc | Mute |
42 * ---------------------------------------------------------------------------------------------------------
43 * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | [ | ] |
44 *----------------------------------------------------------------------------------------------------------
45 * | Esc | A | S | D | F | G | H | J | K | L | ; | Enter | N/A | ' |
46 *----------------------------------------------------------------------------------------------------------
47 * | N/A | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | DEL |
48 *----------------------------------------------------------------------------------------------------------
49 * | Ctrl | GUI | Alt | Lower | Space | Space | Space | Raise | Alt | Left | Down | Up | Right |
50 *----------------------------------------------------------------------------------------------------------
51 */
52
53 [_BASE] = LAYOUT_all(
54 KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL, KC_BSPC, KC_AUDIO_MUTE,
55 KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSLS, KC_LBRC, KC_RBRC,
56 KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , KC_NO, KC_QUOT,
57 KC_NO , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, RSFT_T(KC_QUOT), KC_DEL,
58 KC_LCTL, KC_LGUI, KC_LALT, LOWER , KC_SPC , KC_SPC , KC_SPC , RAISE, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
59 ),
60
61 [_MAC] = LAYOUT_all(
62 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
63 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
64 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
65 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
66 _______, KC_LALT, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
67 ),
68
69 [_GAME] = LAYOUT_all(
70 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
71 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
72 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
73 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
74 _______, _______, MO(_LOWER), KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______, _______
75 ),
76
77 [_LOWER] = LAYOUT_all(
78 _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_F12 , _______,
79 KC_BSPC, KC_SLSH, KC_7 , KC_8 , KC_9 , KC_PPLS, KC_CIRC, KC_LBRC, KC_RBRC, KC_AT , KC_EXLM, KC_BSLS, _______, _______,
80 KC_EQL , KC_0 , KC_4 , KC_5 , KC_6 , KC_MINS, KC_PIPE, KC_LPRN, KC_RPRN, KC_HASH, KC_DQUO, _______, _______, _______,
81 KC_ENT , _______, KC_PAST, KC_1 , KC_2 , KC_3 , KC_UNDS, KC_DLR , KC_LCBR, KC_RCBR, KC_AMPR, KC_PERC, _______, _______,
82 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
83 ),
84
85 [_RAISE] = LAYOUT_all(
86 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
87 _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_BSPC, KC_DEL, KC_END , _______, _______, _______,
88 _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_QUOT, _______, _______, _______,
89 _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, KC_PGDN, _______, _______,
90 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
91 ),
92
93 [_ADJUST] = LAYOUT_all(
94 RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DEBUG,
95 _______, RGB_TOG, RGB_RMOD, RGB_MOD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______,
96 KC_CAPS, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, TG(_GAME), _______, _______, _______, _______, _______, _______,
97 _______, _______, _______, _______, _______, _______, _______, _______, TG(_MAC), _______, _______, _______, _______, _______,
98 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
99 )
100};
101
102bool process_record_user(uint16_t keycode, keyrecord_t *record) {
103 switch (keycode) {
104
105 case LOWER:
106 if (record->event.pressed) {
107 layer_on(_LOWER);
108 update_tri_layer(_LOWER, _RAISE, _ADJUST);
109 } else {
110 layer_off(_LOWER);
111 update_tri_layer(_LOWER, _RAISE, _ADJUST);
112 }
113 return false;
114
115 case RAISE:
116 if (record->event.pressed) {
117 layer_on(_RAISE);
118 update_tri_layer(_LOWER, _RAISE, _ADJUST);
119 } else {
120 layer_off(_RAISE);
121 update_tri_layer(_LOWER, _RAISE, _ADJUST);
122 }
123 return false;
124
125 }
126 return true;
127}
128
129void encoder_update_user(uint8_t index, bool clockwise) {
130 /* With an if statement we can check which encoder was turned. */
131 if (index == 0) { /* First encoder */
132 /* And with another if statement we can check the direction. */
133 if (clockwise) {
134 if (IS_LAYER_ON(_LOWER)){
135 tap_code(KC_RIGHT);
136 } else {
137 tap_code(KC_VOLU);
138 }
139 } else {
140 if (IS_LAYER_ON(_LOWER)){
141 tap_code(KC_LEFT);
142 } else {
143 tap_code(KC_VOLD);
144 }
145 }
146
147 } else if (index == 1) { /* Second encoder. Only supported by Elite-C */
148 if (clockwise) {
149 tap_code(KC_RIGHT);
150 } else {
151 tap_code(KC_LEFT);
152 }
153 }
154}