aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/config.h36
-rw-r--r--keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/keymap.c137
-rw-r--r--keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/readme.md41
-rw-r--r--keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rgb_matrix_map.h109
-rw-r--r--keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rules.mk10
-rw-r--r--users/jonavin/config.h5
-rw-r--r--users/jonavin/readme.md1
7 files changed, 338 insertions, 1 deletions
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/config.h b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/config.h
new file mode 100644
index 000000000..9d842a791
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/config.h
@@ -0,0 +1,36 @@
1/* Copyright 2021 Jonavin Eng
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
19#define TAPPING_TOGGLE 2
20// TT set to two taps
21
22/* Handle GRAVESC combo keys */
23#define GRAVE_ESC_ALT_OVERRIDE
24 //Always send Escape if Alt is pressed
25#define GRAVE_ESC_CTRL_OVERRIDE
26 //Always send Escape if Control is pressed
27
28#define TAPPING_TERM 180
29
30#ifdef RGB_MATRIX_ENABLE
31 #ifdef RGB_MATRIX_STARTUP_MODE
32 #undef RGB_MATRIX_STARTUP_MODE
33 #endif
34 #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR
35 #define RGB_DISABLE_WHEN_USB_SUSPENDED
36#endif
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/keymap.c b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/keymap.c
new file mode 100644
index 000000000..1b85354be
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/keymap.c
@@ -0,0 +1,137 @@
1/* Copyright 2021 Jonavin
2
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7
8This program is distributed in the hope that it will be useful,
9but WITHOUT ANY WARRANTY; without even the implied warranty of
10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License
14along with this program. If not, see <http://www.gnu.org/licenses/>.
15*/
16
17#include QMK_KEYBOARD_H
18#include "rgb_matrix_map.h"
19#include "jonavin.h"
20
21
22const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23 [_BASE] = LAYOUT_65_ansi_blocker(
24 KC_GESC, 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_DEL,
25 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_BSLASH, KC_PGUP,
26 TT(_LOWER), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
27 KC_LSFTCAPSWIN, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
28 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
29 ),
30 [_FN1] = LAYOUT_65_ansi_blocker(
31 KC_GESC, 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_DEL, KC_CALC,
32 _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, RESET, KC_HOME,
33 KC_CAPS, RGB_SPI, RGB_SPD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, EEP_RST, KC_END,
34 KC_LSFT, RGB_NITE, _______, _______, _______, _______, KC_NLCK, _______, RGB_TOD, RGB_TOI, KC_MPLY, _______, KC_VOLU, KC_MUTE,
35 _______, KC_WINLCK, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT
36 ),
37 [_LOWER] = LAYOUT_65_ansi_blocker(
38 KC_TILD, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, _______, _______,
39 _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, KC_TAB, KC_P4, KC_P5, KC_P6, KC_PDOT, _______, _______, _______, KC_HOME,
40 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, KC_P1, KC_P2, KC_P3, KC_NO, KC_PAST, KC_PENT, KC_END,
41 _______, KC_NO, KC_DEL, KC_INS, KC_NO, KC_NO, KC_NO, KC_P0, KC_00, KC_PDOT, KC_PSLS, _______, _______, _______,
42 _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______
43 ),
44 [_RAISE] = LAYOUT_65_ansi_blocker(
45 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
46 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
47 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
48 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
49 _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______
50 ),
51};
52
53#ifdef RGB_MATRIX_ENABLE
54 // Capslock, Scroll lock and Numlock indicator
55 void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
56 if (get_rgb_nightmode()) rgb_matrix_set_color_all(RGB_OFF);
57 if (IS_HOST_LED_ON(USB_LED_SCROLL_LOCK)) {
58 rgb_matrix_set_color(LED_I, RGB_GREEN);
59 }
60
61 #ifdef INVERT_NUMLOCK_INDICATOR
62 if (!IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // on if NUM lock is OFF
63 rgb_matrix_set_color(LED_B, RGB_GREEN);
64 rgb_matrix_set_color(LED_N, RGB_GREEN);
65 rgb_matrix_set_color(LED_M, RGB_GREEN);
66 }
67 #else
68 if (IS_HOST_LED_ON(USB_LED_NUM_LOCK)) { // Normal, on if NUM lock is ON
69 rgb_matrix_set_color(LED_B, RGB_GREEN);
70 rgb_matrix_set_color(LED_N, RGB_GREEN);
71 rgb_matrix_set_color(LED_M, RGB_GREEN);
72 }
73 #endif // INVERT_NUMLOCK_INDICATOR
74
75 if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
76 rgb_matrix_set_color(LED_CAPS, RGB_RED);
77 rgb_matrix_set_color(LED_Q, RGB_RED);
78 rgb_matrix_set_color(LED_A, RGB_RED);
79 }
80 if (keymap_config.no_gui) {
81 rgb_matrix_set_color(LED_LCTL, RGB_RED); //light up Win key when disabled
82 rgb_matrix_set_color(LED_LWIN, RGB_RED); //light up Win key when disabled
83 rgb_matrix_set_color(LED_LALT, RGB_RED); //light up Win key when disabled
84 }
85 switch(get_highest_layer(layer_state)){ // special handling per layer
86 case _FN1: // on Fn layer select what the encoder does when pressed
87 rgb_matrix_set_color(LED_FN, RGB_GOLD);
88 rgb_matrix_set_color(LED_RCTL, RGB_GOLD);
89
90 #ifdef IDLE_TIMEOUT_ENABLE
91 // Add RGB Timeout Indicator -- shows 0 to 139 using num row and qwerty row
92 uint16_t timeout_threshold = get_timeout_threshold();
93 if (timeout_threshold <= 10) rgb_matrix_set_color(LED_LIST_NUMROW[timeout_threshold], RGB_GOLD);
94 else if (timeout_threshold < 140) {
95 rgb_matrix_set_color(LED_LIST_NUMROW[(timeout_threshold % 10)], RGB_GOLD);
96 rgb_matrix_set_color(LED_LIST_QWERTYROW[(timeout_threshold / 10)], RGB_GOLD);
97 } else { // >= 140 minutes, just show these 3 lights
98 rgb_matrix_set_color(LED_LIST_NUMROW[10], RGB_GOLD);
99 rgb_matrix_set_color(LED_LIST_NUMROW[11], RGB_GOLD);
100 rgb_matrix_set_color(LED_LIST_NUMROW[12], RGB_GOLD);
101 }
102 #endif // IDLE_TIMEOUT_ENABLE
103
104 break;
105 case _LOWER:
106 for (uint8_t i=0; i<ARRAYSIZE(LED_LIST_NUMPAD); i++) {
107 rgb_matrix_set_color(LED_LIST_NUMPAD[i], RGB_BLUE);
108 }
109 for (uint8_t i=0; i<ARRAYSIZE(LED_LIST_WASD); i++) {
110 rgb_matrix_set_color(LED_LIST_WASD[i], RGB_BLUE);
111 }
112 break;
113 case _RAISE:
114 rgb_matrix_set_color(LED_SPC, RGB_GREEN);
115 break;
116 default:
117 break;
118 }
119 }
120
121 void suspend_power_down_user(void) {
122 rgb_matrix_set_suspend_state(true);
123 }
124
125 void suspend_wakeup_init_user(void) {
126 rgb_matrix_set_suspend_state(false);
127 }
128#endif
129
130
131void keyboard_post_init_keymap(void) {
132 // keyboard_post_init_user() moved to userspace
133 #ifdef RGB_MATRIX_ENABLE
134 rgb_matrix_mode(RGB_MATRIX_SOLID_COLOR);
135 activate_rgb_nightmode(false); // Set to true if you want to startup in nightmode, otherwise use Fn + Z to toggle
136 #endif
137}
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/readme.md b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/readme.md
new file mode 100644
index 000000000..a28e945cd
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/readme.md
@@ -0,0 +1,41 @@
1# jonavin's KBD 67 Lite keymap
2
3NOTE: This keymap uses features from qmk userspace in user/jonavin. I fyou copy this keymap you should also the user folder.
4
5- Add PrtScr, Scroll Lock, Break, NumLock to Fn layer
6- add double tap of Left Shift to toggle Caps Lock
7- Implement Win key lock using Fn+Win
8- Layer 2 mod on Caps Lock with double-tap to switch to this layer, double tap to switch back
9- Layer 2 provides arrows on WASD and additional nav keys + right hand numpad with 00; an be used for Alt Code entry
10- Layer 2 spacebar Backspace
11
12- LED/RGB Functionality
13 - RGB idle timeout (default 5 minutes)
14 - Can be changed in FN layer with < and >
15 - setting to zero disables timeout
16 - indicators in FN layer using RGB in number and qwerty rows to show the timeout in minutes
17 - LED address location map as enum definition in rgb_matrix_map.h
18 - LED group lists for arrows, numpad, qwerty row, num row LEDs
19 - default startup in single colour mode
20 - Capslock, Scroll Lock, and Num Lock (not set) indicator
21 - Fn key light up GOLD when Fn layer activate
22 - Win Key light up red when Win Lock mode enabled
23 - Layer 2 activation lights up Numpad area
24 - Fn + Z to turn off all RGB lights except rgb indicators; press again to toggle
25
26rules.mk OPTIONS - Active features from userspace
27STARTUP_NUMLOCK_ON = yes
28 - turns on NUMLOCK by default
29
30TD_LSFT_CAPSLOCK_ENABLE = yes
31 - This will enable double tap on Left Shift to toggle CAPSLOCK when using KC_LSFTCAPS
32
33IDLE_TIMEOUT_ENABLE = yes
34 - Enables Timer functionality; for RGB idle timeouts that can be changed dynamically
35
36INVERT_NUMLOCK_INDICATOR = yes
37 - inverts the Num lock indicator, LED is on when num lock is off
38
39## All layers diagram
40![image](https://user-images.githubusercontent.com/71780717/146864247-4ec05ef7-7936-45db-9db9-02fb17d3f7ed.png)
41
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rgb_matrix_map.h b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rgb_matrix_map.h
new file mode 100644
index 000000000..66608ba6e
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rgb_matrix_map.h
@@ -0,0 +1,109 @@
1/* Copyright 2021 Jonavin Eng
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#ifdef RGB_MATRIX_ENABLE
18
19 // Custom RGB Colours
20 #define RGB_GODSPEED 0x00, 0xE4, 0xFF // colour for matching keycaps
21 #define RGB_NAUTILUS 0x00, 0xA4, 0xA9 // Naurilus Font colours
22 #define RGB_PURPLELITE 0x80, 0x00, 0x80 // Purple colours
23
24 // RGB LED locations
25 enum led_location_map {
26 LED_ESC, // 0
27 LED_1, // 1
28 LED_2, // 2
29 LED_3, // 3
30 LED_4, // 4
31 LED_5, // 5
32 LED_6, // 6
33 LED_7, // 7
34 LED_8, // 8
35 LED_9, // 9
36 LED_0, // 10
37 LED_MINS, // 11
38 LED_EQL, // 12
39 LED_BSPC, // 13
40 LED_DEL, // 14
41 LED_TAB, // 15
42 LED_Q, // 16
43 LED_W, // 17
44 LED_E, // 18
45 LED_R, // 19
46 LED_T, // 20
47 LED_Y, // 21
48 LED_U, // 22
49 LED_I, // 23
50 LED_O, // 24
51 LED_P, // 25
52 LED_LBRC, // 26 [
53 LED_RBRC, // 27 ]
54 LED_BSLS, // 28 |
55 LED_PGUP, // 29
56 LED_CAPS, // 30
57 LED_A, // 31
58 LED_S, // 32
59 LED_D, // 33
60 LED_F, // 34
61 LED_G, // 35
62 LED_H, // 36
63 LED_J, // 37
64 LED_K, // 38
65 LED_L, // 39
66 LED_SCLN, // 40 ;
67 LED_QUOT, // 41 "
68 LED_ENT, // 42
69 LED_PGDN, // 43
70 LED_LSFT, // 44
71 LED_Z, // 45
72 LED_X, // 46
73 LED_C, // 47
74 LED_V, // 48
75 LED_B, // 49
76 LED_N, // 50
77 LED_M, // 51
78 LED_COMM, // 52 ,
79 LED_DOT, // 53 .
80 LED_SLSH, // 54 /
81 LED_RSFT, // 55
82 LED_UP, // 56
83 LED_END, // 57
84 LED_LCTL, // 58
85 LED_LWIN, // 59
86 LED_LALT, // 60
87 LED_SPC, // 61
88 LED_FN, // 62
89 LED_RCTL, // 63
90 LED_LEFT, // 64
91 LED_DOWN, // 65
92 LED_RIGHT // 66
93 };
94
95 const uint8_t LED_LIST_WASD[] = { LED_W, LED_A, LED_S, LED_D };
96
97 const uint8_t LED_LIST_ARROWS[] = { LED_LEFT, LED_RIGHT, LED_UP, LED_DOWN };
98
99 const uint8_t LED_LIST_NUMROW[] = { LED_ESC, LED_1, LED_2, LED_3, LED_4, LED_5, LED_6, LED_7, LED_8, LED_9, LED_0, LED_MINS, LED_EQL, LED_BSPC, LED_DEL};
100 const uint8_t LED_LIST_QWERTYROW[] = { LED_TAB, LED_Q, LED_W, LED_E, LED_R, LED_T, LED_Y, LED_U, LED_I, LED_O, LED_P, LED_LBRC, LED_RBRC, LED_BSLS, LED_PGUP};
101
102 const uint8_t LED_LIST_NUMPAD[] = {
103 LED_7, LED_8, LED_9,
104 LED_U, LED_I, LED_O,
105 LED_J, LED_K, LED_L,
106 LED_M, LED_COMM, LED_DOT
107 };
108
109#endif
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rules.mk b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rules.mk
new file mode 100644
index 000000000..91153c75a
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/jonavin/rules.mk
@@ -0,0 +1,10 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes
3MOUSEKEY_ENABLE = no
4TAP_DANCE_ENABLE = yes
5BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
6
7TD_LSFT_CAPSLOCK_ENABLE = yes
8IDLE_TIMEOUT_ENABLE = yes
9STARTUP_NUMLOCK_ON = yes
10INVERT_NUMLOCK_INDICATOR = yes
diff --git a/users/jonavin/config.h b/users/jonavin/config.h
index 7b6e335e3..d694bc537 100644
--- a/users/jonavin/config.h
+++ b/users/jonavin/config.h
@@ -26,6 +26,9 @@
26#define TAPPING_TERM_PER_KEY 26#define TAPPING_TERM_PER_KEY
27 27
28#ifdef RGB_MATRIX_ENABLE 28#ifdef RGB_MATRIX_ENABLE
29 #ifdef RGB_MATRIX_STARTUP_MODE
30 #undef RGB_MATRIX_STARTUP_MODE
31 #endif
29 #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR 32 #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR
30# define RGB_DISABLE_WHEN_USB_SUSPENDED 33 #define RGB_DISABLE_WHEN_USB_SUSPENDED
31#endif 34#endif
diff --git a/users/jonavin/readme.md b/users/jonavin/readme.md
index 8ec0e0ea1..7712eda1e 100644
--- a/users/jonavin/readme.md
+++ b/users/jonavin/readme.md
@@ -119,6 +119,7 @@ LIST OF COMPATIBLE KEYMAPS
119- mechwild/mercutio 119- mechwild/mercutio
120- mechwild/murphpad 120- mechwild/murphpad
121- mechwild/OBE 121- mechwild/OBE
122- kbdfans/kdb67
122- nopunin10did/kastenwagen (*) 123- nopunin10did/kastenwagen (*)
123 124
124 (*) coming soon 125 (*) coming soon