aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dumbpad/keymaps/via/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/dumbpad/keymaps/via/keymap.c')
-rw-r--r--keyboards/dumbpad/keymaps/via/keymap.c175
1 files changed, 0 insertions, 175 deletions
diff --git a/keyboards/dumbpad/keymaps/via/keymap.c b/keyboards/dumbpad/keymaps/via/keymap.c
deleted file mode 100644
index d9f997531..000000000
--- a/keyboards/dumbpad/keymaps/via/keymap.c
+++ /dev/null
@@ -1,175 +0,0 @@
1/* Copyright 2019 imchipwood
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 /*
20 BASE LAYER
21 /-----------------------------------------------------`
22 | | 7 | 8 | 9 | Bkspc |
23 | |---------|---------|---------|---------|
24 | | 4 | 5 | 6 | Esc |
25 | |---------|---------|---------|---------|
26 | | 1 | 2 | 3 | Tab |
27 |-------------|---------|---------|---------|---------|
28 | Left mouse | MO(1) | 0 | . | Enter |
29 \-----------------------------------------------------'
30 */
31 [0] = LAYOUT(
32 KC_7, KC_8, KC_9, KC_BSPC,
33 KC_4, KC_5, KC_6, KC_ESC,
34 KC_1, KC_2, KC_3, KC_TAB,
35 KC_BTN1, MO(1), KC_0, KC_PDOT, KC_ENTER
36 ),
37 /*
38 SUB LAYER
39 /-----------------------------------------------------`
40 | | | | | Reset |
41 | |---------|---------|---------|---------|
42 | | | | | + |
43 | |---------|---------|---------|---------|
44 | | | | | - |
45 |-------------|---------|---------|---------|---------|
46 | LOCK | | MO(2) | | = |
47 \-----------------------------------------------------'
48 */
49 [1] = LAYOUT(
50 _______, _______, _______, RESET,
51 _______, _______, _______, KC_KP_PLUS,
52 _______, _______, _______, KC_KP_MINUS,
53 KC_MUTE, _______, MO(2) , _______, KC_EQL
54 ),
55
56 /*
57 DEBUG LAYER
58 /-----------------------------------------------------`
59 | | | | | Reset |
60 | |---------|---------|---------|---------|
61 | | | | | |
62 | |---------|---------|---------|---------|
63 | | | | | |
64 |-------------|---------|---------|---------|---------|
65 | | | | | |
66 \-----------------------------------------------------'
67 */
68 [2] = LAYOUT(
69 _______, _______, _______, RESET,
70 _______, _______, _______, _______,
71 _______, _______, _______, _______,
72 _______, _______, _______, MO(3) , _______
73 ),
74
75 /*
76 EXTRA LAYER
77 /-----------------------------------------------------`
78 | | | | | |
79 | |---------|---------|---------|---------|
80 | | | | | |
81 | |---------|---------|---------|---------|
82 | | | | | |
83 |-------------|---------|---------|---------|---------|
84 | | | | | |
85 \-----------------------------------------------------'
86 */
87 [3] = LAYOUT(
88 _______, _______, _______, _______,
89 _______, _______, _______, _______,
90 _______, _______, _______, _______,
91 _______, _______, _______, _______, _______
92 ),
93};
94
95bool encoder_update_user(uint8_t index, bool clockwise) {
96 if (index == 0) {
97 switch (get_highest_layer(layer_state)) {
98 case 0:
99 // sub layer - Scroll
100 if (clockwise) {
101 tap_code(KC_MS_WH_DOWN);
102 } else {
103 tap_code(KC_MS_WH_UP);
104 }
105 break;
106
107 case 1:
108 // main layer - Volume
109 if (clockwise) {
110 tap_code(KC_VOLU);
111 } else {
112 tap_code(KC_VOLD);
113 }
114 break;
115
116 case 2:
117 // debug layer - Change track
118 if (clockwise) {
119 tap_code(KC_MNXT);
120 } else {
121 tap_code(KC_MPRV);
122 }
123 break;
124
125 default:
126 // any other layer Scroll
127 if (clockwise) {
128 tap_code(KC_MS_WH_DOWN);
129 } else {
130 tap_code(KC_MS_WH_UP);
131 }
132 break;
133 }
134 }
135 else if (index == 1) {
136 switch (get_highest_layer(layer_state)) {
137 case 0:
138 // sub layer - Volume
139 if (clockwise) {
140 tap_code(KC_VOLU);
141 } else {
142 tap_code(KC_VOLD);
143 }
144 break;
145
146 case 1:
147 // main layer - Scroll
148 if (clockwise) {
149 tap_code(KC_MS_WH_DOWN);
150 } else {
151 tap_code(KC_MS_WH_UP);
152 }
153 break;
154
155 case 2:
156 // debug layer - Brightness
157 if (clockwise) {
158 tap_code(KC_BRID);
159 } else {
160 tap_code(KC_BRIU);
161 }
162 break;
163
164 default:
165 // any other layer Scroll
166 if (clockwise) {
167 tap_code(KC_MS_WH_DOWN);
168 } else {
169 tap_code(KC_MS_WH_UP);
170 }
171 break;
172 }
173 }
174 return true;
175}