diff options
22 files changed, 696 insertions, 0 deletions
diff --git a/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 0000000000..6d88e11674 --- /dev/null +++ b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/keymap.c | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* Copyright 2022 Eugenio Pastoral | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 18 | #include "vnmm.h" | ||
| 19 | |||
| 20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 21 | /* Keymap WIN_BASE: Base Layer (Default Layer) | ||
| 22 | */ | ||
| 23 | [WIN_BASE] = LAYOUT( | ||
| 24 | QK_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_BSLS, KC_PGUP, | ||
| 26 | 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, KC_PGDN, | ||
| 27 | 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, KC_END, | ||
| 28 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, WIN_F, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 29 | |||
| 30 | /* Keymap MAC_BASE: Alternate base layer available if I end up on macbook. | ||
| 31 | */ | ||
| 32 | [MAC_BASE] = LAYOUT( | ||
| 33 | QK_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, | ||
| 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_PGUP, | ||
| 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, KC_PGDN, | ||
| 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, KC_END, | ||
| 37 | KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MAC_F, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 38 | |||
| 39 | |||
| 40 | /* Keymap WIN_FN: Function Layer WIN_BASE | ||
| 41 | */ | ||
| 42 | [WIN_FN] = LAYOUT( | ||
| 43 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 44 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, | ||
| 45 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 46 | _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_VOLU, KC_MPLY, | ||
| 47 | EE_CLR, _______, _______, QK_BOOT, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), | ||
| 48 | |||
| 49 | /* Keymap MAC_FN: Function Layer for MAC_BASE | ||
| 50 | */ | ||
| 51 | [MAC_FN] = LAYOUT( | ||
| 52 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 53 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, _______, _______, | ||
| 54 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 55 | _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_VOLU, KC_MPLY, | ||
| 56 | EE_CLR, _______, _______, QK_BOOT, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), | ||
| 57 | }; | ||
diff --git a/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md new file mode 100644 index 0000000000..d39bdb6e8d --- /dev/null +++ b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # Vnmm's ANSI GMMKV2 65% Layout | ||
| 2 | |||
| 3 | This keymap builds on archrovisual's but with some changes and uses the default key placements | ||
| 4 | |||
| 5 | ## Features | ||
| 6 | |||
| 7 | - Alphabet keys light up red when caps lock is on | ||
| 8 | - Pressing FN shows keys that have a definition | ||
| 9 | - Via enabled | ||
| 10 | - Quick reset with fn+space | ||
diff --git a/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 0000000000..96d2d189b2 --- /dev/null +++ b/keyboards/gmmk/gmmk2/p65/ansi/keymaps/vnmm/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | MOUSEKEY_ENABLE = no | ||
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 0000000000..ad8416dc0f --- /dev/null +++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/keymap.c | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* Copyright 2021 Glorious, LLC <salman@pcgamingrace.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 | #include QMK_KEYBOARD_H | ||
| 18 | #include "vnmm.h" | ||
| 19 | |||
| 20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 21 | [WIN_BASE] = LAYOUT( | ||
| 22 | 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_MUTE, | ||
| 23 | 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_DEL, | ||
| 24 | 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_PGUP, | ||
| 25 | 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, KC_PGDN, | ||
| 26 | 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, KC_END, | ||
| 27 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, WIN_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 28 | ), | ||
| 29 | |||
| 30 | [MAC_BASE] = LAYOUT( | ||
| 31 | 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_MUTE, | ||
| 32 | 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_DEL, | ||
| 33 | 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_PGUP, | ||
| 34 | 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, KC_PGDN, | ||
| 35 | 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, KC_END, | ||
| 36 | KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, WIN_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 37 | ), | ||
| 38 | |||
| 39 | [WIN_FN] = LAYOUT( | ||
| 40 | _______, DF_WIN, DF_MAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, | ||
| 41 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 42 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, RGB_RMOD,RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 44 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, | ||
| 45 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, _______, KC_MNXT | ||
| 46 | ), | ||
| 47 | |||
| 48 | [MAC_FN] = LAYOUT( | ||
| 49 | _______, DF_WIN, DF_MAC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, | ||
| 50 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 51 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 52 | _______, RGB_RMOD,RGB_VAD, RGB_SPD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 53 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, | ||
| 54 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, _______, KC_MNXT | ||
| 55 | ), | ||
| 56 | }; | ||
| 57 | |||
| 58 | #if defined(ENCODER_MAP_ENABLE) | ||
| 59 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 60 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 61 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, | ||
| 62 | [WIN_FN] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, | ||
| 63 | [MAC_FN] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, | ||
| 64 | }; | ||
| 65 | #endif | ||
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md new file mode 100644 index 0000000000..28738e9bfc --- /dev/null +++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # Vnmm's ANSI GMMK pro layout | ||
| 2 | |||
| 3 | This keymap builds on the default but with a more sensible FN layer. | ||
| 4 | |||
| 5 | ## Features | ||
| 6 | |||
| 7 | - Alphabet keys light up red when caps lock is on or shift is pressed | ||
| 8 | - Pressing FN shows keys that have a definition | ||
| 9 | - Via enabled | ||
| 10 | - Reset to bootloader with FN+Space | ||
diff --git a/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/gmmk/pro/rev1/ansi/keymaps/vnmm/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | ENCODER_MAP_ENABLE = yes | ||
diff --git a/keyboards/keychron/v1/ansi/keymaps/vnmm/keymap.c b/keyboards/keychron/v1/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 0000000000..6f26cc8729 --- /dev/null +++ b/keyboards/keychron/v1/ansi/keymaps/vnmm/keymap.c | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* Copyright 2021 @ Keychron (https://www.keychron.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 | #include QMK_KEYBOARD_H | ||
| 18 | #include "vnmm.h" | ||
| 19 | |||
| 20 | // clang-format off | ||
| 21 | |||
| 22 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 23 | [MAC_BASE] = LAYOUT_ansi_82( | ||
| 24 | 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_DEL, KC_DEL, | ||
| 25 | 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_PGUP, | ||
| 26 | 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_PGDN, | ||
| 27 | 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, KC_HOME, | ||
| 28 | 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, | ||
| 29 | KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MAC_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 30 | |||
| 31 | [MAC_FN] = LAYOUT_ansi_82( | ||
| 32 | _______, KC_BRID, KC_BRIU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, | ||
| 33 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, | ||
| 34 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, | ||
| 35 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, | ||
| 36 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, | ||
| 37 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), | ||
| 38 | |||
| 39 | [WIN_BASE] = LAYOUT_ansi_82( | ||
| 40 | 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_DEL, KC_DEL, | ||
| 41 | 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_PGUP, | ||
| 42 | 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_PGDN, | ||
| 43 | 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, KC_HOME, | ||
| 44 | 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, | ||
| 45 | KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, WIN_F, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 46 | |||
| 47 | [WIN_FN] = LAYOUT_ansi_82( | ||
| 48 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, | ||
| 49 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, | ||
| 50 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, | ||
| 51 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_END, | ||
| 52 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, | ||
| 53 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), | ||
| 54 | }; | ||
diff --git a/keyboards/keychron/v1/ansi/keymaps/vnmm/readme.md b/keyboards/keychron/v1/ansi/keymaps/vnmm/readme.md new file mode 100644 index 0000000000..1ee0e0b117 --- /dev/null +++ b/keyboards/keychron/v1/ansi/keymaps/vnmm/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # Vnmm's Keychron V1 ansi layout | ||
| 2 | |||
| 3 | This keymap builds on the default but with some extras I use on all my keyboards | ||
| 4 | |||
| 5 | ## Features | ||
| 6 | |||
| 7 | - Alphabet keys light up red when caps lock is on or shift is pressed | ||
| 8 | - Pressing either FN shows keys that have a definition | ||
| 9 | - Via enabled | ||
| 10 | - Reset to bootloader with FN+Space | ||
diff --git a/keyboards/keychron/v1/ansi/keymaps/vnmm/rules.mk b/keyboards/keychron/v1/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 0000000000..1e5b99807c --- /dev/null +++ b/keyboards/keychron/v1/ansi/keymaps/vnmm/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| VIA_ENABLE = yes | |||
diff --git a/keyboards/keychron/v2/ansi/keymaps/vnmm/keymap.c b/keyboards/keychron/v2/ansi/keymaps/vnmm/keymap.c new file mode 100644 index 0000000000..8e93b07639 --- /dev/null +++ b/keyboards/keychron/v2/ansi/keymaps/vnmm/keymap.c | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* Copyright 2021 @ Keychron (https://www.keychron.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 | #include QMK_KEYBOARD_H | ||
| 18 | #include "vnmm.h" | ||
| 19 | |||
| 20 | // clang-format off | ||
| 21 | |||
| 22 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 23 | [MAC_BASE] = LAYOUT_ansi_67( | ||
| 24 | QK_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_INS, | ||
| 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_BSLS, KC_DEL, | ||
| 26 | 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, KC_HOME, | ||
| 27 | 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, | ||
| 28 | KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, MAC_F, EXT_F, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 29 | |||
| 30 | [WIN_BASE] = LAYOUT_ansi_67( | ||
| 31 | QK_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_INS, | ||
| 32 | 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, | ||
| 33 | 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, KC_HOME, | ||
| 34 | 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, | ||
| 35 | KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, WIN_F, EXT_F, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 36 | |||
| 37 | [MAC_FN] = LAYOUT_ansi_67( | ||
| 38 | KC_GRV, KC_BRID, KC_BRIU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 39 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, | ||
| 40 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, | ||
| 41 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, | ||
| 42 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), | ||
| 43 | |||
| 44 | [WIN_FN] = LAYOUT_ansi_67( | ||
| 45 | KC_GRV, KC_BRID, KC_BRIU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 46 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, | ||
| 47 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, | ||
| 48 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, | ||
| 49 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), | ||
| 50 | |||
| 51 | [EXTRA_FN] = LAYOUT_ansi_67( | ||
| 52 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, | ||
| 53 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 54 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 55 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 56 | _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______) | ||
| 57 | }; | ||
diff --git a/keyboards/keychron/v2/ansi/keymaps/vnmm/readme.md b/keyboards/keychron/v2/ansi/keymaps/vnmm/readme.md new file mode 100644 index 0000000000..c4fd5e9d01 --- /dev/null +++ b/keyboards/keychron/v2/ansi/keymaps/vnmm/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # Vnmm's Keychron V2 ansi layout | ||
| 2 | |||
| 3 | This keymap builds on the default but with some extras I use on all my keyboards | ||
| 4 | |||
| 5 | ## Features | ||
| 6 | |||
| 7 | - Alphabet keys light up red when caps lock is on or shift is pressed | ||
| 8 | - Pressing either FN shows keys that have a definition | ||
| 9 | - Via enabled | ||
| 10 | - Reset to bootloader with FN+Space | ||
diff --git a/keyboards/keychron/v2/ansi/keymaps/vnmm/rules.mk b/keyboards/keychron/v2/ansi/keymaps/vnmm/rules.mk new file mode 100644 index 0000000000..1e5b99807c --- /dev/null +++ b/keyboards/keychron/v2/ansi/keymaps/vnmm/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| VIA_ENABLE = yes | |||
diff --git a/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/keymap.c b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/keymap.c new file mode 100644 index 0000000000..376a715a84 --- /dev/null +++ b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/keymap.c | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* Copyright 2021 @ Keychron (https://www.keychron.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 | #include QMK_KEYBOARD_H | ||
| 18 | #include "vnmm.h" | ||
| 19 | |||
| 20 | // clang-format off | ||
| 21 | |||
| 22 | #define KC_TASK LGUI(KC_TAB) | ||
| 23 | #define KC_FLXP LGUI(KC_E) | ||
| 24 | |||
| 25 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 26 | [MAC_BASE] = LAYOUT_tkl_f13_ansi( | ||
| 27 | KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_PSCR, KC_SCRL, KC_PAUS, | ||
| 28 | 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, | ||
| 29 | 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, | ||
| 30 | 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, | ||
| 31 | 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, | ||
| 32 | KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, KC_RCMD, KC_ROPT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 33 | |||
| 34 | [WIN_BASE] = LAYOUT_tkl_f13_ansi( | ||
| 35 | 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_MUTE, KC_PSCR, KC_SCRL, KC_PAUS, | ||
| 36 | 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, | ||
| 37 | 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, | ||
| 38 | 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, | ||
| 39 | 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, | ||
| 40 | KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), | ||
| 41 | |||
| 42 | [MAC_FN] = LAYOUT_tkl_f13_ansi( | ||
| 43 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, | ||
| 44 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 45 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 46 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, | ||
| 47 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 48 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, _______, KC_MPRV, _______, KC_MNXT), | ||
| 49 | |||
| 50 | [WIN_FN] = LAYOUT_tkl_f13_ansi( | ||
| 51 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, _______, _______, _______, | ||
| 52 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 53 | RGB_TOG, RGB_MOD, RGB_VAI, RGB_SPI, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 54 | _______, RGB_RMOD, RGB_VAD, RGB_SPD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, | ||
| 55 | _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 56 | EE_CLR, _______, _______, QK_BOOT, _______, _______, _______, _______, KC_MPRV, _______, KC_MNXT), | ||
| 57 | }; | ||
| 58 | |||
| 59 | #ifdef ENCODER_MAP_ENABLE | ||
| 60 | const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { | ||
| 61 | [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, | ||
| 62 | [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, | ||
| 63 | [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, | ||
| 64 | [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, | ||
| 65 | }; | ||
| 66 | #endif // ENCODER_MAP_ENABLE | ||
| 67 | |||
| 68 | #ifdef DIP_SWITCH_ENABLE | ||
| 69 | |||
| 70 | bool dip_switch_update_user(uint8_t index, bool active) { | ||
| 71 | if (index == 0) { | ||
| 72 | default_layer_set(1UL << (active ? 1 : 0)); | ||
| 73 | } | ||
| 74 | return false; | ||
| 75 | } | ||
| 76 | |||
| 77 | #endif // DIP_SWITCH_ENABLE \ No newline at end of file | ||
diff --git a/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/rules.mk b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/v3/ansi_encoder/keymaps/vnmm/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | VIA_ENABLE = yes | ||
| 2 | ENCODER_MAP_ENABLE = yes | ||
diff --git a/users/vnmm/config.h b/users/vnmm/config.h new file mode 100644 index 0000000000..3642c5784c --- /dev/null +++ b/users/vnmm/config.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | /* | ||
| 2 | * This program is free software: you can redistribute it and/or modify | ||
| 3 | * it under the terms of the GNU General Public License as published by | ||
| 4 | * the Free Software Foundation, either version 2 of the License, or | ||
| 5 | * (at your option) any later version. | ||
| 6 | * | ||
| 7 | * This program is distributed in the hope that it will be useful, | ||
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 10 | * GNU General Public License for more details. | ||
| 11 | * | ||
| 12 | * You should have received a copy of the GNU General Public License | ||
| 13 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #pragma once | ||
| 17 | |||
| 18 | // All of these config options can be changed by keyboard in their config.h | ||
| 19 | // These are all just the defaults I like for most of my keyboards | ||
| 20 | |||
| 21 | #ifndef RGB_MATRIX_TIMEOUT | ||
| 22 | // If the keyboard is unused for 20 minutes then just turn off RGB | ||
| 23 | # define RGB_MATRIX_TIMEOUT 1200000 // 20 minutes (20 * 60 * 1000ms) | ||
| 24 | |||
| 25 | #endif | ||
| 26 | |||
| 27 | #ifndef CAPS_LOCK_INDICATOR_COLOR | ||
| 28 | // When caps lock is pressed, the letter keys, caps lock, and both shift keys, will light up this color. | ||
| 29 | # define CAPS_LOCK_INDICATOR_COLOR RGB_RED | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #ifndef SHIFT_INDICATOR_COLOR | ||
| 33 | // If defined also light up alphabet keys when either shift is held | ||
| 34 | # define SHIFT_INDICATOR_COLOR RGB_WHITE | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #ifndef CAPS_LOCK_INDICATOR_OTHER | ||
| 38 | // When caps lock is pressed, all other keys will light up this color | ||
| 39 | // #define CAPS_LOCK_INDICATOR_OTHER RGB_WHITE | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #ifndef CAPS_LOCK_INDICATOR_LIGHT_ALPHAS | ||
| 43 | // All alphabet keys will light up, othe rwise just caps lock. | ||
| 44 | # define CAPS_LOCK_INDICATOR_LIGHT_ALPHAS | ||
| 45 | #endif | ||
| 46 | |||
| 47 | #ifndef FN_LAYER_TRANSPARENT_KEYS_COLOR | ||
| 48 | // Keys not defined in the current layer will use this color | ||
| 49 | # define FN_LAYER_TRANSPARENT_KEYS_COLOR RGB_OFF | ||
| 50 | #endif | ||
| 51 | |||
| 52 | // Keys defined in the current layer will use this color | ||
| 53 | #ifndef FN_LAYER_KEYS_COLOR | ||
| 54 | // #define FN_LAYER_KEYS_COLOR RGB_WHITE | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #ifndef CURRENT_LAYER_INDICATOR_COLOR | ||
| 58 | // If a key on a FN layer changes the default layer to the current layer, light up this color | ||
| 59 | # define CURRENT_LAYER_INDICATOR_COLOR RGB_WHITE | ||
| 60 | #endif | ||
| 61 | |||
| 62 | #ifndef NKRO_INDICATOR_COLOR | ||
| 63 | // If NKRO is enabled, the key on the fn layer that toggles it will light up this color | ||
| 64 | # define NKRO_INDICATOR_COLOR RGB_WHITE | ||
| 65 | #endif | ||
| 66 | |||
| 67 | // Don't light up my whole room when the pc is asleep | ||
| 68 | #ifndef RGB_DISABLE_WHEN_USB_SUSPENDED | ||
| 69 | # define RGB_DISABLE_WHEN_USB_SUSPENDED | ||
| 70 | #endif | ||
diff --git a/users/vnmm/keymap_user.h b/users/vnmm/keymap_user.h new file mode 100644 index 0000000000..2262910bcc --- /dev/null +++ b/users/vnmm/keymap_user.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* Copyright 2021 | ||
| 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 | #ifdef DYNAMIC_KEYMAP_LAYER_COUNT | ||
| 20 | #undef DYNAMIC_KEYMAP_LAYER_COUNT | ||
| 21 | #endif | ||
| 22 | #define DYNAMIC_KEYMAP_LAYER_COUNT 5 | ||
| 23 | |||
| 24 | #define WIN_F MO(WIN_FN) | ||
| 25 | #define MAC_F MO(MAC_FN) | ||
| 26 | #define EXT_F MO(EXTRA_FN) | ||
| 27 | |||
| 28 | #define DF_WIN DF(WIN_BASE) | ||
| 29 | #define DF_MAC DF(MAC_BASE) | ||
| 30 | |||
| 31 | // clang-format off | ||
| 32 | |||
| 33 | enum layers { | ||
| 34 | WIN_BASE, | ||
| 35 | MAC_BASE, | ||
| 36 | WIN_FN, | ||
| 37 | MAC_FN, | ||
| 38 | EXTRA_FN | ||
| 39 | }; | ||
| 40 | |||
| 41 | // clang-format on | ||
diff --git a/users/vnmm/readme.md b/users/vnmm/readme.md new file mode 100644 index 0000000000..637e92c063 --- /dev/null +++ b/users/vnmm/readme.md | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # Vnmm's stuff | ||
| 2 | |||
| 3 | This keymap builds on archrovisual's but with some changes and uses the default key placements | ||
| 4 | |||
| 5 | ## Features | ||
| 6 | |||
| 7 | - Alphabet keys light up red when caps lock is on or shift is on | ||
| 8 | - Pressing FN shows keys that have a definition | ||
| 9 | - Via enabled | ||
| 10 | - Quick reset with fn+space | ||
diff --git a/users/vnmm/rgb_matrix_user.c b/users/vnmm/rgb_matrix_user.c new file mode 100644 index 0000000000..c85f86782e --- /dev/null +++ b/users/vnmm/rgb_matrix_user.c | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | /* | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 18 | #include "rgb_matrix_user.h" | ||
| 19 | #include "keymap_user.h" | ||
| 20 | |||
| 21 | keypos_t led_index_key_position[RGB_MATRIX_LED_COUNT]; | ||
| 22 | |||
| 23 | #ifdef SHIFT_INDICATOR_COLOR | ||
| 24 | # define is_shift_pressed (get_mods() & MOD_MASK_SHIFT) | ||
| 25 | #else | ||
| 26 | # define is_shift_pressed false | ||
| 27 | #endif | ||
| 28 | |||
| 29 | void rgb_matrix_init_user(void) { | ||
| 30 | // Set up led_index_key_position | ||
| 31 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
| 32 | for (uint8_t col = 0; col < MATRIX_COLS; col++) { | ||
| 33 | uint8_t led_index = g_led_config.matrix_co[row][col]; | ||
| 34 | if (led_index != NO_LED) { | ||
| 35 | led_index_key_position[led_index] = (keypos_t){.row = row, .col = col}; | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | ||
| 42 | uint8_t current_layer = get_highest_layer(layer_state); | ||
| 43 | bool caps = host_keyboard_led_state().caps_lock; | ||
| 44 | switch (current_layer) { | ||
| 45 | case WIN_BASE: | ||
| 46 | case MAC_BASE: | ||
| 47 | // Light up letters if caps and light up letters and numbers if shift. If shift and caps light up just numbers. | ||
| 48 | #ifdef CAPS_LOCK_INDICATOR_COLOR | ||
| 49 | if (caps && !is_shift_pressed) { | ||
| 50 | rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); | ||
| 51 | # ifdef CAPS_LOCK_INDICATOR_OTHER | ||
| 52 | rgb_matrix_set_color_by_not_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_OTHER); | ||
| 53 | # endif | ||
| 54 | } | ||
| 55 | # ifdef SHIFT_INDICATOR_COLOR | ||
| 56 | else if (is_shift_pressed && !caps) { | ||
| 57 | // Light up letters and other shift affected keys | ||
| 58 | rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_shift_indicator, SHIFT_INDICATOR_COLOR); | ||
| 59 | rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_caps_lock_indicator, CAPS_LOCK_INDICATOR_COLOR); | ||
| 60 | } else if (is_shift_pressed && caps) { | ||
| 61 | // Only shift affected keys light up | ||
| 62 | rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_shift_indicator, SHIFT_INDICATOR_COLOR); | ||
| 63 | } | ||
| 64 | # endif // SHIFT_INDICATOR_COLOR | ||
| 65 | #endif // CAPS_LOCK_INDICATOR_COLOR | ||
| 66 | break; | ||
| 67 | default: | ||
| 68 | #ifdef FN_LAYER_TRANSPARENT_KEYS_COLOR | ||
| 69 | rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_transparent, FN_LAYER_TRANSPARENT_KEYS_COLOR); | ||
| 70 | #endif | ||
| 71 | #ifdef FN_LAYER_KEYS_COLOR | ||
| 72 | rgb_matrix_set_color_by_not_keycode(led_min, led_max, current_layer, is_transparent, FN_LAYER_KEYS_COLOR); | ||
| 73 | #endif | ||
| 74 | #ifdef CURRENT_LAYER_INDICATOR_COLOR | ||
| 75 | rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_default_layer, CURRENT_LAYER_INDICATOR_COLOR); | ||
| 76 | #endif | ||
| 77 | #ifdef NKRO_INDICATOR_COLOR | ||
| 78 | if (keymap_config.nkro) { | ||
| 79 | rgb_matrix_set_color_by_keycode(led_min, led_max, current_layer, is_nkro_indicator, NKRO_INDICATOR_COLOR); | ||
| 80 | } | ||
| 81 | #endif | ||
| 82 | break; | ||
| 83 | } | ||
| 84 | return false; | ||
| 85 | } | ||
| 86 | |||
| 87 | // set color of keys that match the keycode | ||
| 88 | void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { | ||
| 89 | for (uint8_t i = led_min; i < led_max; i++) { | ||
| 90 | uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); | ||
| 91 | if ((*is_keycode)(keycode)) { | ||
| 92 | rgb_matrix_set_color(i, red, green, blue); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | // set color of all leds that are not a certain keycode | ||
| 98 | void rgb_matrix_set_color_by_not_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue) { | ||
| 99 | for (uint8_t i = led_min; i < led_max; i++) { | ||
| 100 | uint16_t keycode = keymap_key_to_keycode(layer, led_index_key_position[i]); | ||
| 101 | if (!(*is_keycode)(keycode)) { | ||
| 102 | rgb_matrix_set_color(i, red, green, blue); | ||
| 103 | } | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 107 | // check if keycode is a letter or shift or caps lock | ||
| 108 | bool is_caps_lock_indicator(uint16_t keycode) { | ||
| 109 | #ifdef CAPS_LOCK_INDICATOR_LIGHT_ALPHAS | ||
| 110 | return (KC_A <= keycode && keycode <= KC_Z) || keycode == KC_CAPS || keycode == KC_LSFT || keycode == KC_RSFT; | ||
| 111 | #else | ||
| 112 | return keycode == KC_CAPS; | ||
| 113 | #endif | ||
| 114 | } | ||
| 115 | |||
| 116 | // check if keycode is the DF to default layer | ||
| 117 | #ifdef CURRENT_LAYER_INDICATOR_COLOR | ||
| 118 | bool is_default_layer(uint16_t keycode) { | ||
| 119 | return keycode == DF(get_highest_layer(default_layer_state)); | ||
| 120 | } | ||
| 121 | #endif | ||
| 122 | |||
| 123 | // check if keycode is the NKRO toggle | ||
| 124 | #ifdef NKRO_INDICATOR_COLOR | ||
| 125 | bool is_nkro_indicator(uint16_t keycode) { | ||
| 126 | return keycode == NK_TOGG; | ||
| 127 | } | ||
| 128 | #endif | ||
| 129 | |||
| 130 | // check if keycode is transparent | ||
| 131 | bool is_transparent(uint16_t keycode) { | ||
| 132 | return keycode == KC_TRNS; | ||
| 133 | } | ||
| 134 | |||
| 135 | // check if keycode is affected by shift on the number row | ||
| 136 | #ifdef SHIFT_INDICATOR_COLOR | ||
| 137 | bool is_shift_indicator(uint16_t keycode) { | ||
| 138 | return (KC_1 <= keycode && keycode <= KC_0) || keycode == KC_MINS || keycode == KC_EQL || keycode == KC_GRV || keycode == KC_BSLS || keycode == KC_LBRC || keycode == KC_RBRC || keycode == KC_SCLN || keycode == KC_QUOT || keycode == KC_COMM || keycode == KC_DOT || keycode == KC_SLSH || keycode == QK_GESC || keycode == KC_LSFT || keycode == KC_RSFT; | ||
| 139 | } | ||
| 140 | #endif | ||
diff --git a/users/vnmm/rgb_matrix_user.h b/users/vnmm/rgb_matrix_user.h new file mode 100644 index 0000000000..7fe3d8229a --- /dev/null +++ b/users/vnmm/rgb_matrix_user.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 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 | void rgb_matrix_init_user(void); | ||
| 20 | |||
| 21 | void rgb_matrix_set_color_by_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); | ||
| 22 | void rgb_matrix_set_color_by_not_keycode(uint8_t led_min, uint8_t led_max, uint8_t layer, bool (*is_keycode)(uint16_t), uint8_t red, uint8_t green, uint8_t blue); | ||
| 23 | |||
| 24 | bool is_default_layer(uint16_t keycode); | ||
| 25 | bool is_nkro_indicator(uint16_t keycode); | ||
| 26 | bool is_caps_lock_indicator(uint16_t keycode); | ||
| 27 | bool is_transparent(uint16_t keycode); | ||
| 28 | bool is_shift_indicator(uint16_t keycode); | ||
diff --git a/users/vnmm/rules.mk b/users/vnmm/rules.mk new file mode 100644 index 0000000000..2b601fd3e5 --- /dev/null +++ b/users/vnmm/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | SRC += vnmm.c | ||
| 2 | |||
| 3 | ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) | ||
| 4 | SRC += rgb_matrix_user.c | ||
| 5 | endif | ||
diff --git a/users/vnmm/vnmm.c b/users/vnmm/vnmm.c new file mode 100644 index 0000000000..a4d4a7928e --- /dev/null +++ b/users/vnmm/vnmm.c | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* | ||
| 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 | #include "vnmm.h" | ||
| 18 | |||
| 19 | void keyboard_post_init_user(void) { | ||
| 20 | #ifdef RGB_MATRIX_ENABLE | ||
| 21 | rgb_matrix_init_user(); | ||
| 22 | #endif | ||
| 23 | } \ No newline at end of file | ||
diff --git a/users/vnmm/vnmm.h b/users/vnmm/vnmm.h new file mode 100644 index 0000000000..03723c3deb --- /dev/null +++ b/users/vnmm/vnmm.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* | ||
| 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 | #pragma once | ||
| 17 | |||
| 18 | #include "keymap_user.h" | ||
| 19 | #ifdef RGB_MATRIX_ENABLE | ||
| 20 | # include "rgb_matrix_user.h" | ||
| 21 | #endif \ No newline at end of file | ||
