Skip to content

Commit 63639a8

Browse files
rmblauCrandel
authored andcommitted
add support for drop ctrl v1 (vial-kb#563)
* add support for drop ctrl v1 * fix for unlock keyboard combo and add support for vialrgb * remove empty layers
1 parent 289e5f1 commit 63639a8

File tree

4 files changed

+388
-0
lines changed

4 files changed

+388
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* Copyright 2023 Matthew Blau (mrb1105@gmail.com)
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+
17+
#pragma once
18+
#define USB_LED_INDICATOR_ENABLE
19+
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
20+
#define RGB_MATRIX_KEYPRESSES
21+
22+
#define VIAL_KEYBOARD_UID {0xE8, 0xB3, 0x53, 0x4E, 0xEF, 0xFF, 0xD7, 0xC4}
23+
#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 }
24+
#define VIAL_UNLOCK_COMBO_COLS { 0, 2 }
25+
#define VIAL_COMBO_ENTRIES 4
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/* Made by InonL (@InonL), June 2022
2+
Modified for vial by Matthew Blau (rmblau)
3+
* Based on the default keymap, added two blank layers for VIA
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
#include QMK_KEYBOARD_H
19+
20+
enum ctrl_keycodes {
21+
U_T_AUTO = QK_KB_0, //USB Extra Port Toggle Auto Detect / Always Active
22+
U_T_AGCR, //USB Toggle Automatic GCR control
23+
DBG_TOG, //DEBUG Toggle On / Off
24+
DBG_MTRX, //DEBUG Toggle Matrix Prints
25+
DBG_KBD, //DEBUG Toggle Keyboard Prints
26+
DBG_MOU, //DEBUG Toggle Mouse Prints
27+
MD_BOOT, //Restart into bootloader after hold timeout
28+
};
29+
30+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31+
[0] = LAYOUT(
32+
KC_ESC, 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_PSCR, KC_SCRL, KC_PAUS,
33+
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_INS, KC_HOME, KC_PGUP,
34+
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
35+
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
36+
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
37+
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
38+
),
39+
[1] = LAYOUT(
40+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______,
41+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU,
42+
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD,
43+
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______,
44+
_______, RGB_TOG, _______, _______, _______, MD_BOOT, NK_TOGG, DBG_TOG, _______, _______, _______, _______, _______,
45+
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
46+
),
47+
};
48+
49+
#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
50+
#define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
51+
#define MODS_ALT (get_mods() & MOD_MASK_ALT)
52+
53+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
54+
static uint32_t key_timer;
55+
56+
switch (keycode) {
57+
case U_T_AUTO:
58+
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
59+
TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
60+
}
61+
return false;
62+
case U_T_AGCR:
63+
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
64+
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
65+
}
66+
return false;
67+
case DBG_TOG:
68+
if (record->event.pressed) {
69+
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
70+
}
71+
return false;
72+
case DBG_MTRX:
73+
if (record->event.pressed) {
74+
TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
75+
}
76+
return false;
77+
case DBG_KBD:
78+
if (record->event.pressed) {
79+
TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
80+
}
81+
return false;
82+
case DBG_MOU:
83+
if (record->event.pressed) {
84+
TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
85+
}
86+
return false;
87+
case MD_BOOT:
88+
if (record->event.pressed) {
89+
key_timer = timer_read32();
90+
} else {
91+
if (timer_elapsed32(key_timer) >= 500) {
92+
reset_keyboard();
93+
}
94+
}
95+
return false;
96+
case RGB_TOG:
97+
if (record->event.pressed) {
98+
switch (rgb_matrix_get_flags()) {
99+
case LED_FLAG_ALL: {
100+
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
101+
rgb_matrix_set_color_all(0, 0, 0);
102+
}
103+
break;
104+
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
105+
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
106+
rgb_matrix_set_color_all(0, 0, 0);
107+
}
108+
break;
109+
case LED_FLAG_UNDERGLOW: {
110+
rgb_matrix_set_flags(LED_FLAG_NONE);
111+
rgb_matrix_disable_noeeprom();
112+
}
113+
break;
114+
default: {
115+
rgb_matrix_set_flags(LED_FLAG_ALL);
116+
rgb_matrix_enable_noeeprom();
117+
}
118+
break;
119+
}
120+
}
121+
return false;
122+
default:
123+
return true; //Process all other keycodes normally
124+
}
125+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VIA_ENABLE = yes
2+
VIAL_ENABLE = yes
3+
VIALRGB_ENABLE = yes
4+
TAP_DANCE_ENABLE = no
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
{
2+
"name": "Drop CTRL",
3+
"vendorId": "0x04D8",
4+
"productId": "0xEED2",
5+
"lighting": "vialrgb",
6+
"customKeycodes": [
7+
{
8+
"name": "USB Extra Port Detect",
9+
"title": "USB Extra Port Toggle Auto Detect / Always Active",
10+
"shortName": "U_T_AUTO"
11+
},
12+
{
13+
"name": "USB GCR Control",
14+
"title": "USB Toggle Automatic GCR control",
15+
"shortName": "U_T_AGCR"
16+
},
17+
{
18+
"name": "Debug Toggle",
19+
"title": "Toggle Debug Mode",
20+
"shortName": "DBG_TOG"
21+
},
22+
{
23+
"name": "Debug Matrix",
24+
"title": "Toggle Matrix Debug Prints",
25+
"shortName": "DBG_MTRX"
26+
},
27+
{
28+
"name": "Debug Keyboard",
29+
"title": "Toggle Keyboard Debug Prints",
30+
"shortName": "DBG_KBD"
31+
},
32+
{
33+
"name": "Debug Mouse",
34+
"title": "Toggle Mouse Debug Prints",
35+
"shortName": "DBG_MOU"
36+
},
37+
{
38+
"name": "Bootloader",
39+
"title": "Restart into bootloader after holding for 3 seconds",
40+
"shortName": "MD_BOOT"
41+
}
42+
],
43+
"matrix": {"rows": 11, "cols": 8},
44+
"layouts": {
45+
"keymap": [
46+
[
47+
{
48+
"c": "#777777"
49+
},
50+
"0,0",
51+
{
52+
"x": 1,
53+
"c": "#cccccc"
54+
},
55+
"0,1",
56+
"0,2",
57+
"0,3",
58+
"0,4",
59+
{
60+
"x": 0.5
61+
},
62+
"0,5",
63+
"0,6",
64+
"0,7",
65+
"6,0",
66+
{
67+
"x": 0.5
68+
},
69+
"6,1",
70+
"6,2",
71+
"6,3",
72+
"6,4",
73+
{
74+
"x": 0.5
75+
},
76+
"6,5",
77+
"6,6",
78+
"6,7"
79+
],
80+
[
81+
{
82+
"y": 0.5
83+
},
84+
"1,0",
85+
"1,1",
86+
"1,2",
87+
"1,3",
88+
"1,4",
89+
"1,5",
90+
"1,6",
91+
"1,7",
92+
"7,0",
93+
"7,1",
94+
"7,2",
95+
"7,3",
96+
"7,4",
97+
{
98+
"w": 2
99+
},
100+
"7,5",
101+
{
102+
"x": 0.5
103+
},
104+
"7,6",
105+
"7,7",
106+
"9,7"
107+
],
108+
[
109+
{
110+
"w": 1.5
111+
},
112+
"2,0",
113+
"2,1",
114+
"2,2",
115+
"2,3",
116+
"2,4",
117+
"2,5",
118+
"2,6",
119+
"2,7",
120+
"8,0",
121+
"8,1",
122+
"8,2",
123+
"8,3",
124+
"8,4",
125+
{
126+
"w": 1.5
127+
},
128+
"8,5",
129+
{
130+
"x": 0.5
131+
},
132+
"8,6",
133+
"8,7",
134+
"9,6"
135+
],
136+
[
137+
{
138+
"w": 1.75
139+
},
140+
"3,0",
141+
"3,1",
142+
"3,2",
143+
"3,3",
144+
"3,4",
145+
"3,5",
146+
"3,6",
147+
"3,7",
148+
"9,0",
149+
"9,1",
150+
"9,2",
151+
"9,3",
152+
{
153+
"c": "#777777",
154+
"w": 2.25
155+
},
156+
"9,4"
157+
],
158+
[
159+
{
160+
"c": "#aaaaaa",
161+
"w": 2.25
162+
},
163+
"4,0",
164+
{
165+
"c": "#cccccc"
166+
},
167+
"4,1",
168+
"4,2",
169+
"4,3",
170+
"4,4",
171+
"4,5",
172+
"4,6",
173+
"4,7",
174+
"10,0",
175+
"10,1",
176+
"10,2",
177+
{
178+
"c": "#aaaaaa",
179+
"w": 2.75
180+
},
181+
"10,3",
182+
{
183+
"x": 1.5,
184+
"c": "#777777"
185+
},
186+
"9,5"
187+
],
188+
[
189+
{
190+
"c": "#aaaaaa",
191+
"w": 1.25
192+
},
193+
"5,0",
194+
{
195+
"w": 1.25
196+
},
197+
"5,1",
198+
{
199+
"w": 1.25
200+
},
201+
"5,2",
202+
{
203+
"c": "#cccccc",
204+
"w": 6.25
205+
},
206+
"5,3",
207+
{
208+
"c": "#aaaaaa",
209+
"w": 1.25
210+
},
211+
"5,4",
212+
{
213+
"w": 1.25
214+
},
215+
"5,5",
216+
{
217+
"w": 1.25
218+
},
219+
"5,6",
220+
{
221+
"w": 1.25
222+
},
223+
"5,7",
224+
{
225+
"x": 0.5,
226+
"c": "#777777"
227+
},
228+
"10,4",
229+
"10,5",
230+
"10,6"
231+
]
232+
]
233+
}
234+
}

0 commit comments

Comments
 (0)