diff options
35 files changed, 3370 insertions, 18 deletions
diff --git a/keyboards/aozora/hotswap/config.h b/keyboards/aozora/hotswap/config.h new file mode 100644 index 000000000..60277f263 --- /dev/null +++ b/keyboards/aozora/hotswap/config.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* Copyright 2021 Salmon Cat Studio | ||
| 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 | #include "config_common.h" | ||
| 20 | |||
| 21 | /* USB Device descriptor parameter */ | ||
| 22 | #define VENDOR_ID 0xCA75 | ||
| 23 | #define PRODUCT_ID 0x4014 | ||
| 24 | #define DEVICE_VER 0x0001 | ||
| 25 | #define MANUFACTURER Salmon Cat Studio | ||
| 26 | #define PRODUCT Aozora | ||
| 27 | |||
| 28 | /* key matrix size */ | ||
| 29 | #define MATRIX_ROWS 5 | ||
| 30 | #define MATRIX_COLS 16 | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Keyboard Matrix Assignments | ||
| 34 | * | ||
| 35 | * Change this to how you wired your keyboard | ||
| 36 | * COLS: AVR pins used for columns, left to right | ||
| 37 | * ROWS: AVR pins used for rows, top to bottom | ||
| 38 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
| 39 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
| 40 | * | ||
| 41 | */ | ||
| 42 | #define MATRIX_ROW_PINS { F6, F5, F4, F1, F0 } | ||
| 43 | #define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, D4, D6, D7, B4, B5, B6, C6, C7, F7 } | ||
| 44 | |||
| 45 | #define DIODE_DIRECTION COL2ROW | ||
diff --git a/keyboards/aozora/hotswap/hotswap.c b/keyboards/aozora/hotswap/hotswap.c new file mode 100644 index 000000000..f8197c3c0 --- /dev/null +++ b/keyboards/aozora/hotswap/hotswap.c | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* Copyright 2021 Salmon Cat Studio | ||
| 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 "hotswap.h" \ No newline at end of file | ||
diff --git a/keyboards/aozora/hotswap/hotswap.h b/keyboards/aozora/hotswap/hotswap.h new file mode 100644 index 000000000..5282aaf81 --- /dev/null +++ b/keyboards/aozora/hotswap/hotswap.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* Copyright 2021 Salmon Cat Studio | ||
| 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 | #include "quantum.h" | ||
| 20 | |||
| 21 | #define LAYOUT( \ | ||
| 22 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ | ||
| 23 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ | ||
| 24 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ | ||
| 25 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, K3E, K3F, \ | ||
| 26 | K40, K41, K42, K44, K48, K49, K4A, K4D, K4E, K4F \ | ||
| 27 | ) { \ | ||
| 28 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ | ||
| 29 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ | ||
| 30 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, KC_NO }, \ | ||
| 31 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D, K3E, K3F }, \ | ||
| 32 | { K40, K41, K42, KC_NO, K44, KC_NO, KC_NO, KC_NO, K48, K49, K4A, KC_NO, KC_NO, K4D, K4E, K4F }, \ | ||
| 33 | } | ||
| 34 | |||
diff --git a/keyboards/aozora/hotswap/info.json b/keyboards/aozora/hotswap/info.json new file mode 100644 index 000000000..9d8e8c51f --- /dev/null +++ b/keyboards/aozora/hotswap/info.json | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Aozora", | ||
| 3 | "url": "https://salmoncat.studio/pages/aozora-%E9%9D%92%E7%A9%BA-6-9-21-7-10-21", | ||
| 4 | "maintainer": "Food", | ||
| 5 | "width": 17.25, | ||
| 6 | "height": 5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT": { | ||
| 9 | "layout": [ | ||
| 10 | {"label":"K00 (F6,B0)", "x":0, "y":0}, | ||
| 11 | {"label":"K01 (F6,B1)", "x":1, "y":0}, | ||
| 12 | {"label":"K02 (F6,B2)", "x":2, "y":0}, | ||
| 13 | {"label":"K03 (F6,B3)", "x":3, "y":0}, | ||
| 14 | {"label":"K04 (F6,B7)", "x":4, "y":0}, | ||
| 15 | {"label":"K05 (F6,D0)", "x":5, "y":0}, | ||
| 16 | {"label":"K06 (F6,D1)", "x":6, "y":0}, | ||
| 17 | {"label":"K07 (F6,D4)", "x":7, "y":0}, | ||
| 18 | {"label":"K08 (F6,D6)", "x":8, "y":0}, | ||
| 19 | {"label":"K09 (F6,D7)", "x":9, "y":0}, | ||
| 20 | {"label":"K0A (F6,B4)", "x":10, "y":0}, | ||
| 21 | {"label":"K0B (F6,B5)", "x":11, "y":0}, | ||
| 22 | {"label":"K0C (F6,B6)", "x":12, "y":0}, | ||
| 23 | {"label":"K0D (F6,C6)", "x":13, "y":0, "w":2}, | ||
| 24 | {"label":"K0E (F6,C7)", "x":15.25, "y":0}, | ||
| 25 | {"label":"K0F (F6,F7)", "x":16.25, "y":0}, | ||
| 26 | {"label":"K10 (F5,B0)", "x":0, "y":1, "w":1.5}, | ||
| 27 | {"label":"K11 (F5,B1)", "x":1.5, "y":1}, | ||
| 28 | {"label":"K12 (F5,B2)", "x":2.5, "y":1}, | ||
| 29 | {"label":"K13 (F5,B3)", "x":3.5, "y":1}, | ||
| 30 | {"label":"K14 (F5,B7)", "x":4.5, "y":1}, | ||
| 31 | {"label":"K15 (F5,D0)", "x":5.5, "y":1}, | ||
| 32 | {"label":"K16 (F5,D1)", "x":6.5, "y":1}, | ||
| 33 | {"label":"K17 (F5,D4)", "x":7.5, "y":1}, | ||
| 34 | {"label":"K18 (F5,D6)", "x":8.5, "y":1}, | ||
| 35 | {"label":"K19 (F5,D7)", "x":9.5, "y":1}, | ||
| 36 | {"label":"K1A (F5,B4)", "x":10.5, "y":1}, | ||
| 37 | {"label":"K1B (F5,B5)", "x":11.5, "y":1}, | ||
| 38 | {"label":"K1C (F5,B6)", "x":12.5, "y":1}, | ||
| 39 | {"label":"K1D (F5,C6)", "x":13.5, "y":1, "w":1.5}, | ||
| 40 | {"label":"K1E (F5,C7)", "x":15.25, "y":1}, | ||
| 41 | {"label":"K1F (F5,F7)", "x":16.25, "y":1}, | ||
| 42 | {"label":"K20 (F4,B0)", "x":0, "y":2, "w":1.75}, | ||
| 43 | {"label":"K21 (F4,B1)", "x":1.75, "y":2}, | ||
| 44 | {"label":"K22 (F4,B2)", "x":2.75, "y":2}, | ||
| 45 | {"label":"K23 (F4,B3)", "x":3.75, "y":2}, | ||
| 46 | {"label":"K24 (F4,B7)", "x":4.75, "y":2}, | ||
| 47 | {"label":"K25 (F4,D0)", "x":5.75, "y":2}, | ||
| 48 | {"label":"K26 (F4,D1)", "x":6.75, "y":2}, | ||
| 49 | {"label":"K27 (F4,D4)", "x":7.75, "y":2}, | ||
| 50 | {"label":"K28 (F4,D6)", "x":8.75, "y":2}, | ||
| 51 | {"label":"K29 (F4,D7)", "x":9.75, "y":2}, | ||
| 52 | {"label":"K2A (F4,B4)", "x":10.75, "y":2}, | ||
| 53 | {"label":"K2B (F4,B5)", "x":11.75, "y":2}, | ||
| 54 | {"label":"K2D (F4,C6)", "x":12.75, "y":2, "w":2.25}, | ||
| 55 | {"label":"K30 (F1,B0)", "x":0, "y":3, "w":2.25}, | ||
| 56 | {"label":"K31 (F1,B1)", "x":2.25, "y":3}, | ||
| 57 | {"label":"K32 (F1,B2)", "x":3.25, "y":3}, | ||
| 58 | {"label":"K33 (F1,B3)", "x":4.25, "y":3}, | ||
| 59 | {"label":"K34 (F1,B7)", "x":5.25, "y":3}, | ||
| 60 | {"label":"K35 (F1,D0)", "x":6.25, "y":3}, | ||
| 61 | {"label":"K36 (F1,D1)", "x":7.25, "y":3}, | ||
| 62 | {"label":"K37 (F1,D4)", "x":8.25, "y":3}, | ||
| 63 | {"label":"K38 (F1,D6)", "x":9.25, "y":3}, | ||
| 64 | {"label":"K39 (F1,D7)", "x":10.25, "y":3}, | ||
| 65 | {"label":"K3A (F1,B4)", "x":11.25, "y":3}, | ||
| 66 | {"label":"K3D (F1,C6)", "x":12.25, "y":3, "w":2.75}, | ||
| 67 | {"label":"K3E (F1,C7)", "x":15.25, "y":3}, | ||
| 68 | {"label":"K3F (F1,F7)", "x":16.25, "y":3}, | ||
| 69 | {"label":"K40 (F0,B0)", "x":0, "y":4, "w":1.25}, | ||
| 70 | {"label":"K41 (F0,B1)", "x":1.25, "y":4, "w":1.25}, | ||
| 71 | {"label":"K42 (F0,B2)", "x":2.5, "y":4, "w":1.25}, | ||
| 72 | {"label":"K44 (F0,B7)", "x":3.75, "y":4, "w":6.25}, | ||
| 73 | {"label":"K48 (F0,D6)", "x":10, "y":4, "w":1.25}, | ||
| 74 | {"label":"K49 (F0,D7)", "x":11.25, "y":4, "w":1.25}, | ||
| 75 | {"label":"K4A (F0,B4)", "x":12.5, "y":4, "w":1.25}, | ||
| 76 | {"label":"K4D (F0,C6)", "x":14.25, "y":4}, | ||
| 77 | {"label":"K4E (F0,C7)", "x":15.25, "y":4}, | ||
| 78 | {"label":"K4F (F0,F7)", "x":16.25, "y":4} | ||
| 79 | ] | ||
| 80 | } | ||
| 81 | } | ||
| 82 | ,"meta": "https://noroadsleft.github.io/kbf_qmk_converter/" | ||
| 83 | } | ||
diff --git a/keyboards/aozora/hotswap/keymaps/default/keymap.c b/keyboards/aozora/hotswap/keymaps/default/keymap.c new file mode 100644 index 000000000..f941f5dff --- /dev/null +++ b/keyboards/aozora/hotswap/keymaps/default/keymap.c | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* Copyright 2021 Salmon Cat Studio | ||
| 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 | |||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 20 | [0] = LAYOUT( | ||
| 21 | KC_ESC, 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_PSCR, KC_PGUP, | ||
| 22 | 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_PGDN, | ||
| 23 | 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, | ||
| 24 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, MO(1), | ||
| 25 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 26 | ), | ||
| 27 | [1] = LAYOUT( | ||
| 28 | 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, KC_F13, KC_F14, KC_F15, | ||
| 29 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 31 | _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 33 | ), | ||
| 34 | |||
| 35 | }; | ||
diff --git a/keyboards/aozora/hotswap/readme.md b/keyboards/aozora/hotswap/readme.md new file mode 100644 index 000000000..201ae3a73 --- /dev/null +++ b/keyboards/aozora/hotswap/readme.md | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # Aozora | ||
| 2 | |||
| 3 | A 65%-Style 6-Key keyboard featuring a cloud-shaped badge. | ||
| 4 | |||
| 5 |  | ||
| 6 | |||
| 7 | * Keyboard Maintainer: [Food](https://github.com/Phooood) | ||
| 8 | * Hardware Supported: [Aozora](https://salmoncat.studio/pages/aozora-%E9%9D%92%E7%A9%BA-6-9-21-7-10-21) | ||
| 9 | * Hardware Availability: [salmoncat.studio](https://salmoncat.studio/pages/aozora-%E9%9D%92%E7%A9%BA-6-9-21-7-10-21) | GB is over. | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make aozora/hotswap:default | ||
| 14 | |||
| 15 | To reset, press the button on the back of the PCB. | ||
| 16 | |||
| 17 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). \ No newline at end of file | ||
diff --git a/keyboards/aozora/hotswap/rules.mk b/keyboards/aozora/hotswap/rules.mk new file mode 100644 index 000000000..63d0199d0 --- /dev/null +++ b/keyboards/aozora/hotswap/rules.mk | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = atmel-dfu | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | ||
| 11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 13 | CONSOLE_ENABLE = yes # Console for debug | ||
| 14 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 17 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 18 | NKRO_ENABLE = no # USB Nkey Rollover | ||
| 19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 20 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
| 21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
| 22 | AUDIO_ENABLE = no # Audio output | ||
| 23 | |||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.c b/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.c index 2826c0898..5b50b51bd 100644 --- a/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.c +++ b/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.c | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 | |||
| 1 | #include "mkiirgb.h" | 17 | #include "mkiirgb.h" |
| 2 | #ifdef RGB_MATRIX_ENABLE | 18 | #ifdef RGB_MATRIX_ENABLE |
| 3 | const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { | 19 | const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = { |
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.h b/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.h index e61ff9683..c297a02e8 100644 --- a/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.h +++ b/keyboards/kbdfans/kbd67/mkiirgb/mkiirgb.h | |||
| @@ -1,16 +1,26 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 | |||
| 1 | #pragma once | 17 | #pragma once |
| 2 | #define XXX KC_NO | 18 | |
| 19 | #if defined(KEYBOARD_kbdfans_kbd67_mkiirgb_v1) | ||
| 20 | #include "v1.h" | ||
| 21 | #elif defined(KEYBOARD_kbdfans_kbd67_mkiirgb_v2) | ||
| 22 | #include "v2.h" | ||
| 23 | #elif defined(KEYBOARD_kbdfans_kbd67_mkiirgb_v3) | ||
| 24 | #include "v3.h" | ||
| 25 | #endif | ||
| 3 | #include "quantum.h" | 26 | #include "quantum.h" |
| 4 | #define LAYOUT_65_ansi_blocker( \ | ||
| 5 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ | ||
| 6 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ | ||
| 7 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ | ||
| 8 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ | ||
| 9 | K40, K41, K42, K45, K48, K4A, K4B, K4D, K4E \ | ||
| 10 | ) { \ | ||
| 11 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ | ||
| 12 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ | ||
| 13 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ | ||
| 14 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ | ||
| 15 | { K40, K41, K42, XXX, XXX, K45, XXX, XXX, K48, XXX, K4A, K4B, XXX, K4D, K4E } \ | ||
| 16 | } | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/readme.md b/keyboards/kbdfans/kbd67/mkiirgb/readme.md index 3a5621d84..58338df0f 100644 --- a/keyboards/kbdfans/kbd67/mkiirgb/readme.md +++ b/keyboards/kbdfans/kbd67/mkiirgb/readme.md | |||
| @@ -3,17 +3,19 @@ | |||
| 3 | A customizable 65% RGB keyboard. | 3 | A customizable 65% RGB keyboard. |
| 4 | 4 | ||
| 5 | * Keyboard Maintainer: [moyi4681](https://github.com/moyi4681) | 5 | * Keyboard Maintainer: [moyi4681](https://github.com/moyi4681) |
| 6 | * Hardware Supported: KBD67 Mk.II RGB V1 and V2 | 6 | * Hardware Supported: KBD67 Mk.II RGB V1, V2, and V3 |
| 7 | * Hardware Availability: [kbdfans](https://kbdfans.myshopify.com/) | 7 | * Hardware Availability: [kbdfans](https://kbdfans.myshopify.com/) |
| 8 | 8 | ||
| 9 | There are two versions of the KBD67 MKII RGB. Please use the appropriate firmware for your board. | 9 | There are three versions of the KBD67 MKII RGB. Please use the appropriate firmware for your board. |
| 10 | 10 | ||
| 11 | * V1: STM32F303 (Arm), takes `.bin` files | 11 | * V1: STM32F303 (Arm), takes `.bin` files |
| 12 | * V2: ATmega32U4 (AVR), takes `.hex` files | 12 | * V2: ATmega32U4 (AVR), takes `.hex` files |
| 13 | * V3: Atmega32U4 (AVR), takes `.bin` files | ||
| 13 | 14 | ||
| 14 | Make example for this keyboard (after setting up your build environment): | 15 | Make example for this keyboard (after setting up your build environment): |
| 15 | 16 | ||
| 16 | make kbdfans/kbd67/mkiirgb/v1:default # Arm (STM32F303) | 17 | make kbdfans/kbd67/mkiirgb/v1:default # Arm (STM32F303) |
| 17 | make kbdfans/kbd67/mkiirgb/v2:default # AVR (ATmega32U4) | 18 | make kbdfans/kbd67/mkiirgb/v2:default # AVR (ATmega32U4) |
| 19 | make kbdfans/kbd67/mkiirgb/v3:default # AVR (ATmega32U4) | ||
| 18 | 20 | ||
| 19 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | 21 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). |
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v1/.noci b/keyboards/kbdfans/kbd67/mkiirgb/v1/.noci deleted file mode 100644 index e69de29bb..000000000 --- a/keyboards/kbdfans/kbd67/mkiirgb/v1/.noci +++ /dev/null | |||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v1/v1.c b/keyboards/kbdfans/kbd67/mkiirgb/v1/v1.c new file mode 100644 index 000000000..466b0148a --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v1/v1.c | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 "v1.h" | ||
| 18 | #ifdef RGB_MATRIX_ENABLE | ||
| 19 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | ||
| 20 | |||
| 21 | {0, C8_8, C7_8, C6_8}, // LA17 | ||
| 22 | {0, C9_8, C7_7, C6_7}, // LA16 | ||
| 23 | {0, C9_7, C8_7, C6_6}, // LA15 | ||
| 24 | {0, C9_6, C8_6, C7_6}, // LA14 | ||
| 25 | {0, C9_5, C8_5, C7_5}, // LA13 | ||
| 26 | {0, C9_4, C8_4, C7_4}, // LA12 | ||
| 27 | {0, C9_3, C8_3, C7_3}, // LA11 | ||
| 28 | {0, C9_2, C8_2, C7_2}, // LA10 | ||
| 29 | {0, C9_1, C8_1, C7_1}, // LA9 | ||
| 30 | {0, C2_9, C3_9, C4_9}, // LB0 | ||
| 31 | {0, C1_9, C3_10, C4_10}, // LB1 | ||
| 32 | {0, C1_10, C2_10, C4_11}, // LB2 | ||
| 33 | {0, C1_11, C2_11, C3_11}, // LB3 | ||
| 34 | {0, C1_13, C2_13, C3_13}, // LB5 | ||
| 35 | {0, C1_14, C2_14, C3_14}, // LB6 | ||
| 36 | |||
| 37 | {0, C1_7, C2_7, C3_7}, // LA7 | ||
| 38 | {0, C1_6, C2_6, C3_6}, // LA6 | ||
| 39 | {0, C1_5, C2_5, C3_5}, // LA5 | ||
| 40 | {0, C1_4, C2_4, C3_4}, // LA4 | ||
| 41 | {0, C1_3, C2_3, C3_3}, // LA3 | ||
| 42 | {0, C1_2, C2_2, C4_3}, // LA2 | ||
| 43 | {0, C1_1, C3_2, C4_2}, // LA1 | ||
| 44 | {0, C2_1, C3_1, C4_1}, // LA0 | ||
| 45 | {0, C9_9, C8_9, C7_9}, // LB9 | ||
| 46 | {0, C9_10, C8_10, C7_10}, // LB10 | ||
| 47 | {0, C9_11, C8_11, C7_11}, // LB11 | ||
| 48 | {0, C9_12, C8_12, C7_12}, // LB12 | ||
| 49 | {0, C9_13, C8_13, C7_13}, // LB13 | ||
| 50 | {0, C9_14, C8_14, C7_14}, // LB14 | ||
| 51 | {0, C1_15, C2_15, C3_15}, // LB7 | ||
| 52 | |||
| 53 | {0, C1_8, C2_8, C3_8}, // LA8 | ||
| 54 | {1, C9_6, C8_6, C7_6}, // LC14 | ||
| 55 | {1, C9_5, C8_5, C7_5}, // LC13 | ||
| 56 | {1, C9_4, C8_4, C7_4}, // LC12 | ||
| 57 | {1, C9_3, C8_3, C7_3}, // LC11 | ||
| 58 | {1, C9_2, C8_2, C7_2}, // LC10 | ||
| 59 | {1, C9_1, C8_1, C7_1}, // LC9 | ||
| 60 | {1, C2_9, C3_9, C4_9}, // LD0 | ||
| 61 | {1, C1_9, C3_10, C4_10}, // LD1 | ||
| 62 | {1, C1_10, C2_10, C4_11}, // LD2 | ||
| 63 | {1, C1_11, C2_11, C3_11}, // LD3 | ||
| 64 | {1, C1_12, C2_12, C3_12}, // LD4 | ||
| 65 | {1, C1_13, C2_13, C3_13}, // LD5 | ||
| 66 | {0, C1_16, C2_16, C3_16}, // LB8 | ||
| 67 | |||
| 68 | {1, C9_8, C7_7, C6_7}, // LC16 | ||
| 69 | {1, C1_5, C2_5, C3_5}, // LC5 | ||
| 70 | {1, C1_4, C2_4, C3_4}, // LC4 | ||
| 71 | {1, C1_3, C2_3, C3_3}, // LC3 | ||
| 72 | {1, C1_2, C2_2, C4_3}, // LC2 | ||
| 73 | {1, C1_1, C3_2, C4_2}, // LC1 | ||
| 74 | {1, C9_9, C8_9, C7_9}, // LD9 | ||
| 75 | {1, C9_10, C8_10, C7_10}, // LD10 | ||
| 76 | {1, C9_11, C8_11, C7_11}, // LD11 | ||
| 77 | {1, C9_12, C8_12, C7_12}, // LD12 | ||
| 78 | {1, C1_14, C2_14, C3_14}, // LD6 | ||
| 79 | {1, C1_15, C2_15, C3_15}, // LD7 | ||
| 80 | {1, C1_16, C2_16, C3_16}, // LD8 | ||
| 81 | {0, C9_15, C8_15, C6_14}, // LB15 | ||
| 82 | |||
| 83 | {1, C8_8, C7_8, C6_8}, // LC17 | ||
| 84 | {1, C1_8, C2_8, C3_8}, // LC8 | ||
| 85 | {1, C1_7, C2_7, C3_7}, // LC7 | ||
| 86 | {1, C2_1, C3_1, C4_1}, // LC0 | ||
| 87 | {1, C9_14, C8_14, C7_14}, // LD14 | ||
| 88 | {1, C9_15, C8_15, C6_14}, // LD15 | ||
| 89 | {1, C8_16, C7_16, C6_16}, // LD17 | ||
| 90 | {0, C8_16, C7_16, C6_16}, // LB17 | ||
| 91 | {0, C9_16, C7_15, C6_15}, // LB16 | ||
| 92 | |||
| 93 | }; | ||
| 94 | |||
| 95 | led_config_t g_led_config = { { | ||
| 96 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, | ||
| 97 | { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, | ||
| 98 | { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED,42, 43 }, | ||
| 99 | { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, NO_LED,56, 57 }, | ||
| 100 | { 58, 59, 60, NO_LED, NO_LED, 61, NO_LED, NO_LED, 62, NO_LED, 63, 64, NO_LED, 65, 66 } | ||
| 101 | }, { | ||
| 102 | {0,0},{15,0},{30,0},{45,0},{60,0},{75,0},{90,0},{105,0},{120,0},{135,0},{150,0},{165,0},{180,0},{203,0},{224,0}, | ||
| 103 | {4,16},{23,16},{38,16},{53,16},{68,16},{83,16},{98,16},{113,16},{128,16},{143,16},{158,16},{173,16},{188,16},{206,16},{224,16}, | ||
| 104 | {6,32},{26,32},{41,32},{56,32},{71,32},{86,32},{101,32},{116,32},{131,32},{146,32},{161,32},{176,32},{201,32},{224,32}, | ||
| 105 | {9,48},{34,48},{49,48},{64,48},{79,48},{94,48},{109,48},{124,48},{139,48},{154,48},{169,48},{189,48},{210,48},{224,48}, | ||
| 106 | {2,64},{21,64},{39,64},{96,64},{152,64},{171,64},{195,64},{210,64},{224,64} | ||
| 107 | }, { | ||
| 108 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 109 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 110 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 111 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 112 | 1, 1, 1, 4, 1, 1, 1, 1, 1 | ||
| 113 | } }; | ||
| 114 | |||
| 115 | |||
| 116 | __attribute__ ((weak)) | ||
| 117 | void rgb_matrix_indicators_user(void) | ||
| 118 | { | ||
| 119 | if (host_keyboard_led_state().caps_lock) | ||
| 120 | { | ||
| 121 | rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | #endif | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v1/v1.h b/keyboards/kbdfans/kbd67/mkiirgb/v1/v1.h new file mode 100644 index 000000000..96b5fef5e --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v1/v1.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 XXX KC_NO | ||
| 19 | #include "quantum.h" | ||
| 20 | #define LAYOUT_65_ansi_blocker( \ | ||
| 21 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ | ||
| 22 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ | ||
| 23 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ | ||
| 24 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ | ||
| 25 | K40, K41, K42, K45, K48, K4A, K4B, K4D, K4E \ | ||
| 26 | ) { \ | ||
| 27 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ | ||
| 28 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ | ||
| 29 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ | ||
| 30 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ | ||
| 31 | { K40, K41, K42, XXX, XXX, K45, XXX, XXX, K48, XXX, K4A, K4B, XXX, K4D, K4E } \ | ||
| 32 | } | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v2/v2.c b/keyboards/kbdfans/kbd67/mkiirgb/v2/v2.c new file mode 100644 index 000000000..951dd028f --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v2/v2.c | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 "v2.h" | ||
| 18 | #ifdef RGB_MATRIX_ENABLE | ||
| 19 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | ||
| 20 | |||
| 21 | {0, C8_8, C7_8, C6_8}, // LA17 | ||
| 22 | {0, C9_8, C7_7, C6_7}, // LA16 | ||
| 23 | {0, C9_7, C8_7, C6_6}, // LA15 | ||
| 24 | {0, C9_6, C8_6, C7_6}, // LA14 | ||
| 25 | {0, C9_5, C8_5, C7_5}, // LA13 | ||
| 26 | {0, C9_4, C8_4, C7_4}, // LA12 | ||
| 27 | {0, C9_3, C8_3, C7_3}, // LA11 | ||
| 28 | {0, C9_2, C8_2, C7_2}, // LA10 | ||
| 29 | {0, C9_1, C8_1, C7_1}, // LA9 | ||
| 30 | {0, C2_9, C3_9, C4_9}, // LB0 | ||
| 31 | {0, C1_9, C3_10, C4_10}, // LB1 | ||
| 32 | {0, C1_10, C2_10, C4_11}, // LB2 | ||
| 33 | {0, C1_11, C2_11, C3_11}, // LB3 | ||
| 34 | {0, C1_13, C2_13, C3_13}, // LB5 | ||
| 35 | {0, C1_14, C2_14, C3_14}, // LB6 | ||
| 36 | |||
| 37 | {0, C1_7, C2_7, C3_7}, // LA7 | ||
| 38 | {0, C1_6, C2_6, C3_6}, // LA6 | ||
| 39 | {0, C1_5, C2_5, C3_5}, // LA5 | ||
| 40 | {0, C1_4, C2_4, C3_4}, // LA4 | ||
| 41 | {0, C1_3, C2_3, C3_3}, // LA3 | ||
| 42 | {0, C1_2, C2_2, C4_3}, // LA2 | ||
| 43 | {0, C1_1, C3_2, C4_2}, // LA1 | ||
| 44 | {0, C2_1, C3_1, C4_1}, // LA0 | ||
| 45 | {0, C9_9, C8_9, C7_9}, // LB9 | ||
| 46 | {0, C9_10, C8_10, C7_10}, // LB10 | ||
| 47 | {0, C9_11, C8_11, C7_11}, // LB11 | ||
| 48 | {0, C9_12, C8_12, C7_12}, // LB12 | ||
| 49 | {0, C9_13, C8_13, C7_13}, // LB13 | ||
| 50 | {0, C9_14, C8_14, C7_14}, // LB14 | ||
| 51 | {0, C1_15, C2_15, C3_15}, // LB7 | ||
| 52 | |||
| 53 | {0, C1_8, C2_8, C3_8}, // LA8 | ||
| 54 | {1, C9_6, C8_6, C7_6}, // LC14 | ||
| 55 | {1, C9_5, C8_5, C7_5}, // LC13 | ||
| 56 | {1, C9_4, C8_4, C7_4}, // LC12 | ||
| 57 | {1, C9_3, C8_3, C7_3}, // LC11 | ||
| 58 | {1, C9_2, C8_2, C7_2}, // LC10 | ||
| 59 | {1, C9_1, C8_1, C7_1}, // LC9 | ||
| 60 | {1, C2_9, C3_9, C4_9}, // LD0 | ||
| 61 | {1, C1_9, C3_10, C4_10}, // LD1 | ||
| 62 | {1, C1_10, C2_10, C4_11}, // LD2 | ||
| 63 | {1, C1_11, C2_11, C3_11}, // LD3 | ||
| 64 | {1, C1_12, C2_12, C3_12}, // LD4 | ||
| 65 | {1, C1_13, C2_13, C3_13}, // LD5 | ||
| 66 | {0, C1_16, C2_16, C3_16}, // LB8 | ||
| 67 | |||
| 68 | {1, C9_8, C7_7, C6_7}, // LC16 | ||
| 69 | {1, C1_5, C2_5, C3_5}, // LC5 | ||
| 70 | {1, C1_4, C2_4, C3_4}, // LC4 | ||
| 71 | {1, C1_3, C2_3, C3_3}, // LC3 | ||
| 72 | {1, C1_2, C2_2, C4_3}, // LC2 | ||
| 73 | {1, C1_1, C3_2, C4_2}, // LC1 | ||
| 74 | {1, C9_9, C8_9, C7_9}, // LD9 | ||
| 75 | {1, C9_10, C8_10, C7_10}, // LD10 | ||
| 76 | {1, C9_11, C8_11, C7_11}, // LD11 | ||
| 77 | {1, C9_12, C8_12, C7_12}, // LD12 | ||
| 78 | {1, C1_14, C2_14, C3_14}, // LD6 | ||
| 79 | {1, C1_15, C2_15, C3_15}, // LD7 | ||
| 80 | {1, C1_16, C2_16, C3_16}, // LD8 | ||
| 81 | {0, C9_15, C8_15, C6_14}, // LB15 | ||
| 82 | |||
| 83 | {1, C8_8, C7_8, C6_8}, // LC17 | ||
| 84 | {1, C1_8, C2_8, C3_8}, // LC8 | ||
| 85 | {1, C1_7, C2_7, C3_7}, // LC7 | ||
| 86 | {1, C2_1, C3_1, C4_1}, // LC0 | ||
| 87 | {1, C9_14, C8_14, C7_14}, // LD14 | ||
| 88 | {1, C9_15, C8_15, C6_14}, // LD15 | ||
| 89 | {1, C8_16, C7_16, C6_16}, // LD17 | ||
| 90 | {0, C8_16, C7_16, C6_16}, // LB17 | ||
| 91 | {0, C9_16, C7_15, C6_15}, // LB16 | ||
| 92 | |||
| 93 | }; | ||
| 94 | |||
| 95 | led_config_t g_led_config = { { | ||
| 96 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, | ||
| 97 | { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, | ||
| 98 | { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED,42, 43 }, | ||
| 99 | { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, NO_LED,56, 57 }, | ||
| 100 | { 58, 59, 60, NO_LED, NO_LED, 61, NO_LED, NO_LED, 62, NO_LED, 63, 64, NO_LED, 65, 66 } | ||
| 101 | }, { | ||
| 102 | {0,0},{15,0},{30,0},{45,0},{60,0},{75,0},{90,0},{105,0},{120,0},{135,0},{150,0},{165,0},{180,0},{203,0},{224,0}, | ||
| 103 | {4,16},{23,16},{38,16},{53,16},{68,16},{83,16},{98,16},{113,16},{128,16},{143,16},{158,16},{173,16},{188,16},{206,16},{224,16}, | ||
| 104 | {6,32},{26,32},{41,32},{56,32},{71,32},{86,32},{101,32},{116,32},{131,32},{146,32},{161,32},{176,32},{201,32},{224,32}, | ||
| 105 | {9,48},{34,48},{49,48},{64,48},{79,48},{94,48},{109,48},{124,48},{139,48},{154,48},{169,48},{189,48},{210,48},{224,48}, | ||
| 106 | {2,64},{21,64},{39,64},{96,64},{152,64},{171,64},{195,64},{210,64},{224,64} | ||
| 107 | }, { | ||
| 108 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 109 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 110 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 111 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 112 | 1, 1, 1, 4, 1, 1, 1, 1, 1 | ||
| 113 | } }; | ||
| 114 | |||
| 115 | |||
| 116 | __attribute__ ((weak)) | ||
| 117 | void rgb_matrix_indicators_user(void) | ||
| 118 | { | ||
| 119 | if (host_keyboard_led_state().caps_lock) | ||
| 120 | { | ||
| 121 | rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | #endif | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v2/v2.h b/keyboards/kbdfans/kbd67/mkiirgb/v2/v2.h new file mode 100644 index 000000000..96b5fef5e --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v2/v2.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 XXX KC_NO | ||
| 19 | #include "quantum.h" | ||
| 20 | #define LAYOUT_65_ansi_blocker( \ | ||
| 21 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ | ||
| 22 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ | ||
| 23 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ | ||
| 24 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ | ||
| 25 | K40, K41, K42, K45, K48, K4A, K4B, K4D, K4E \ | ||
| 26 | ) { \ | ||
| 27 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ | ||
| 28 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ | ||
| 29 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ | ||
| 30 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ | ||
| 31 | { K40, K41, K42, XXX, XXX, K45, XXX, XXX, K48, XXX, K4A, K4B, XXX, K4D, K4E } \ | ||
| 32 | } | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v3/config.h b/keyboards/kbdfans/kbd67/mkiirgb/v3/config.h new file mode 100755 index 000000000..1ee83cdc9 --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v3/config.h | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 | #include "config_common.h" | ||
| 20 | |||
| 21 | /* USB Device descriptor parameter */ | ||
| 22 | #define VENDOR_ID 0x4B42 // KB | ||
| 23 | #define PRODUCT_ID 0x1226 | ||
| 24 | #define DEVICE_VER 0x0002 | ||
| 25 | #define MANUFACTURER KBDfans | ||
| 26 | #define PRODUCT kbd67mkiirgb v3 | ||
| 27 | |||
| 28 | /* key matrix size */ | ||
| 29 | #define MATRIX_ROWS 5 | ||
| 30 | #define MATRIX_COLS 15 | ||
| 31 | #define MATRIX_ROW_PINS { F0, F1, F4, E6, C6 } | ||
| 32 | #define MATRIX_COL_PINS { F7, F6, F5, C7, B0, B1, B2, B3, B4, D7, D6, D4, D5, D3, D2} | ||
| 33 | #define UNUSED_PINS | ||
| 34 | |||
| 35 | /* COL2ROW, ROW2COL*/ | ||
| 36 | #define DIODE_DIRECTION COL2ROW | ||
| 37 | |||
| 38 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 39 | #define DEBOUNCE 5 | ||
| 40 | /* disable these deprecated features by default */ | ||
| 41 | #define NO_ACTION_MACRO | ||
| 42 | #define NO_ACTION_FUNCTION | ||
| 43 | #ifdef RGB_MATRIX_ENABLE | ||
| 44 | #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects | ||
| 45 | #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended | ||
| 46 | #define USB_SUSPEND_WAKEUP_DELAY 5000 | ||
| 47 | #define RGB_MATRIX_KEYPRESSES | ||
| 48 | #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 49 | #define DISABLE_RGB_MATRIX_BAND_SAT | ||
| 50 | #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
| 51 | #define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
| 52 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 53 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 54 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 55 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 56 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 57 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 58 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 59 | #define DISABLE_RGB_MATRIX_SPLASH | ||
| 60 | #define DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 61 | #define DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 62 | #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
| 63 | #define DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 64 | #define DISABLE_RGB_MATRIX_RAINDROPS | ||
| 65 | #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 66 | #define RGB_MATRIX_LED_PROCESS_LIMIT 4 | ||
| 67 | #define RGB_MATRIX_LED_FLUSH_LIMIT 26 | ||
| 68 | #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_ALL | ||
| 69 | #define DRIVER_ADDR_1 0b0110000 | ||
| 70 | #define DRIVER_ADDR_2 0b0110000 // this is here for compliancy reasons. | ||
| 71 | #define DRIVER_COUNT 1 | ||
| 72 | #define DRIVER_1_LED_TOTAL 67 | ||
| 73 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL | ||
| 74 | #define DRIVER_INDICATOR_LED_TOTAL 0 | ||
| 75 | #endif | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v3/readme.md b/keyboards/kbdfans/kbd67/mkiirgb/v3/readme.md new file mode 100644 index 000000000..d62d4a517 --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v3/readme.md | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # KBD67 Mk.II RGB V3 (Hotswap) | ||
| 2 | |||
| 3 | A hotswap 65% keyboard with USB C, inswitch RGB, and ESD protection. | ||
| 4 | |||
| 5 | * Keyboard Maintainer: [moyi4681](https://github.com/moyi4681) | ||
| 6 | * Hardware Supported: KBD67 Mk.II RGB V3 | ||
| 7 | * Hardware Availability: [kbdfans](https://kbdfans.myshopify.com/) | ||
| 8 | |||
| 9 | Make example for this keyboard (after setting up your build environment): | ||
| 10 | |||
| 11 | make kbdfans/kbd67/mkiirgb/v3:default | ||
| 12 | |||
| 13 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v3/rules.mk b/keyboards/kbdfans/kbd67/mkiirgb/v3/rules.mk new file mode 100755 index 000000000..5c48a9bf7 --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v3/rules.mk | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = lufa-ms | ||
| 6 | BOOTLOADER_SIZE = 6144 | ||
| 7 | |||
| 8 | # Build Options | ||
| 9 | # change yes to no to disable | ||
| 10 | # | ||
| 11 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | ||
| 12 | MOUSEKEY_ENABLE = no # Mouse keys | ||
| 13 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 14 | CONSOLE_ENABLE = no # Console for debug | ||
| 15 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 16 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 17 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 18 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 19 | NKRO_ENABLE = yes # USB Nkey Rollover | ||
| 20 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 21 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
| 22 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
| 23 | AUDIO_ENABLE = no # Audio output | ||
| 24 | RGB_MATRIX_ENABLE = yes # Use RGB matrix | ||
| 25 | RGB_MATRIX_DRIVER = IS31FL3741 | ||
| 26 | LTO_ENABLE = yes | ||
| 27 | |||
| 28 | LAYOUTS = 65_ansi_blocker | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v3/v3.c b/keyboards/kbdfans/kbd67/mkiirgb/v3/v3.c new file mode 100755 index 000000000..a082f36ba --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v3/v3.c | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 "v3.h" | ||
| 18 | |||
| 19 | #ifdef RGB_MATRIX_ENABLE | ||
| 20 | |||
| 21 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | ||
| 22 | {0, CS21_SW1, CS20_SW1, CS19_SW1}, | ||
| 23 | {0, CS21_SW2, CS20_SW2, CS19_SW2}, | ||
| 24 | {0, CS21_SW3, CS20_SW3, CS19_SW3}, | ||
| 25 | {0, CS21_SW4, CS20_SW4, CS19_SW4}, | ||
| 26 | {0, CS21_SW5, CS20_SW5, CS19_SW5}, | ||
| 27 | {0, CS21_SW6, CS20_SW6, CS19_SW6}, | ||
| 28 | {0, CS21_SW7, CS20_SW7, CS19_SW7}, | ||
| 29 | {0, CS21_SW8, CS20_SW8, CS19_SW8}, | ||
| 30 | {0, CS24_SW1, CS23_SW1, CS22_SW1}, | ||
| 31 | {0, CS24_SW2, CS23_SW2, CS22_SW2}, | ||
| 32 | {0, CS24_SW3, CS23_SW3, CS22_SW3}, | ||
| 33 | {0, CS24_SW4, CS23_SW4, CS22_SW4}, | ||
| 34 | {0, CS24_SW5, CS23_SW5, CS22_SW5}, | ||
| 35 | {0, CS24_SW6, CS23_SW6, CS22_SW6}, | ||
| 36 | {0, CS24_SW7, CS23_SW7, CS22_SW7}, | ||
| 37 | |||
| 38 | {0, CS15_SW1, CS14_SW1, CS13_SW1}, | ||
| 39 | {0, CS15_SW2, CS14_SW2, CS13_SW2}, | ||
| 40 | {0, CS15_SW3, CS14_SW3, CS13_SW3}, | ||
| 41 | {0, CS15_SW4, CS14_SW4, CS13_SW4}, | ||
| 42 | {0, CS15_SW5, CS14_SW5, CS13_SW5}, | ||
| 43 | {0, CS15_SW6, CS14_SW6, CS13_SW6}, | ||
| 44 | {0, CS15_SW7, CS14_SW7, CS13_SW7}, | ||
| 45 | {0, CS15_SW8, CS14_SW8, CS13_SW8}, | ||
| 46 | {0, CS30_SW1, CS29_SW1, CS28_SW1}, | ||
| 47 | {0, CS30_SW2, CS29_SW2, CS28_SW2}, | ||
| 48 | {0, CS30_SW3, CS29_SW3, CS28_SW3}, | ||
| 49 | {0, CS30_SW4, CS29_SW4, CS28_SW4}, | ||
| 50 | {0, CS30_SW5, CS29_SW5, CS28_SW5}, | ||
| 51 | {0, CS30_SW6, CS29_SW6, CS28_SW6}, | ||
| 52 | {0, CS30_SW7, CS29_SW7, CS28_SW7}, | ||
| 53 | |||
| 54 | {0, CS12_SW1, CS11_SW1, CS10_SW1}, | ||
| 55 | {0, CS12_SW2, CS11_SW2, CS10_SW2}, | ||
| 56 | {0, CS12_SW3, CS11_SW3, CS10_SW3}, | ||
| 57 | {0, CS12_SW4, CS11_SW4, CS10_SW4}, | ||
| 58 | {0, CS12_SW5, CS11_SW5, CS10_SW5}, | ||
| 59 | {0, CS12_SW6, CS11_SW6, CS10_SW6}, | ||
| 60 | {0, CS12_SW7, CS11_SW7, CS10_SW7}, | ||
| 61 | {0, CS12_SW8, CS11_SW8, CS10_SW8}, | ||
| 62 | {0, CS33_SW1, CS32_SW1, CS31_SW1}, | ||
| 63 | {0, CS33_SW2, CS32_SW2, CS31_SW2}, | ||
| 64 | {0, CS33_SW3, CS32_SW3, CS31_SW3}, | ||
| 65 | {0, CS33_SW4, CS32_SW4, CS31_SW4}, | ||
| 66 | {0, CS33_SW5, CS32_SW5, CS31_SW5}, | ||
| 67 | {0, CS33_SW7, CS32_SW7, CS31_SW7}, | ||
| 68 | |||
| 69 | {0, CS9_SW1, CS8_SW1, CS7_SW1}, | ||
| 70 | {0, CS9_SW2, CS8_SW2, CS7_SW2}, | ||
| 71 | {0, CS9_SW3, CS8_SW3, CS7_SW3}, | ||
| 72 | {0, CS9_SW4, CS8_SW4, CS7_SW4}, | ||
| 73 | {0, CS9_SW5, CS8_SW5, CS7_SW5}, | ||
| 74 | {0, CS9_SW6, CS8_SW6, CS7_SW6}, | ||
| 75 | {0, CS9_SW7, CS8_SW7, CS7_SW7}, | ||
| 76 | {0, CS9_SW8, CS8_SW8, CS7_SW8}, | ||
| 77 | {0, CS36_SW1, CS35_SW1, CS34_SW1}, | ||
| 78 | {0, CS36_SW2, CS35_SW2, CS34_SW2}, | ||
| 79 | {0, CS36_SW3, CS35_SW3, CS34_SW3}, | ||
| 80 | {0, CS36_SW4, CS35_SW4, CS34_SW4}, | ||
| 81 | {0, CS36_SW5, CS35_SW5, CS34_SW5}, | ||
| 82 | {0, CS36_SW7, CS35_SW7, CS34_SW7}, | ||
| 83 | |||
| 84 | {0, CS3_SW1, CS2_SW1, CS1_SW1}, | ||
| 85 | {0, CS3_SW2, CS2_SW2, CS1_SW2}, | ||
| 86 | {0, CS3_SW3, CS2_SW3, CS1_SW3}, | ||
| 87 | {0, CS3_SW6, CS2_SW6, CS1_SW6}, | ||
| 88 | // {0, CS39_SW1, CS38_SW1, CS37_SW1}, | ||
| 89 | {0, CS39_SW2, CS38_SW2, CS37_SW2}, | ||
| 90 | {0, CS39_SW3, CS38_SW3, CS37_SW3}, | ||
| 91 | {0, CS39_SW4, CS38_SW4, CS37_SW4}, | ||
| 92 | {0, CS39_SW5, CS38_SW5, CS37_SW5}, | ||
| 93 | {0, CS39_SW7, CS38_SW7, CS37_SW7} | ||
| 94 | |||
| 95 | }; | ||
| 96 | led_config_t g_led_config = { { | ||
| 97 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }, | ||
| 98 | { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 }, | ||
| 99 | { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED,42, 43 }, | ||
| 100 | { 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, NO_LED,55, 56, 57 }, | ||
| 101 | { 58, 59, 60, NO_LED, NO_LED, 61, NO_LED, NO_LED, NO_LED, 62, 63, 64, 65, 66 } | ||
| 102 | }, { | ||
| 103 | {0,0},{15,0},{30,0},{45,0},{60,0},{75,0},{90,0},{105,0},{120,0},{135,0},{150,0},{165,0},{180,0},{203,0},{224,0}, | ||
| 104 | {4,16},{23,16},{38,16},{53,16},{68,16},{83,16},{98,16},{113,16},{128,16},{143,16},{158,16},{173,16},{188,16},{206,16},{224,16}, | ||
| 105 | {6,32},{26,32},{41,32},{56,32},{71,32},{86,32},{101,32},{116,32},{131,32},{146,32},{161,32},{176,32},{201,32},{224,32}, | ||
| 106 | {9,48},{34,48},{49,48},{64,48},{79,48},{94,48},{109,48},{124,48},{139,48},{154,48},{169,48},{189,48},{210,48},{224,48}, | ||
| 107 | { 2, 64 }, { 21, 64 }, { 39, 64 }, { 96, 64 }, { 150, 64 }, { 165, 64 }, { 195, 64 }, { 210, 64 }, { 224, 64 } | ||
| 108 | |||
| 109 | }, { | ||
| 110 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 111 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 112 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 113 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 114 | 1, 1, 1, 4, 1, 1, 1, 1, 1 | ||
| 115 | } }; | ||
| 116 | |||
| 117 | |||
| 118 | __attribute__ ((weak)) | ||
| 119 | void rgb_matrix_indicators_user(void) | ||
| 120 | { | ||
| 121 | if (host_keyboard_led_state().caps_lock) | ||
| 122 | { | ||
| 123 | rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); | ||
| 124 | } | ||
| 125 | } | ||
| 126 | #endif | ||
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/v3/v3.h b/keyboards/kbdfans/kbd67/mkiirgb/v3/v3.h new file mode 100755 index 000000000..7b3c387fe --- /dev/null +++ b/keyboards/kbdfans/kbd67/mkiirgb/v3/v3.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* Copyright 2021 DZTECH <moyi4681@live.cn> | ||
| 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 XXX KC_NO | ||
| 19 | #include "quantum.h" | ||
| 20 | #define LAYOUT_65_ansi_blocker( \ | ||
| 21 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ | ||
| 22 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ | ||
| 23 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ | ||
| 24 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ | ||
| 25 | K40, K41, K42, K45, K48, K4A, K4B, K4D, K4E \ | ||
| 26 | ) { \ | ||
| 27 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ | ||
| 28 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ | ||
| 29 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ | ||
| 30 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D, K3E }, \ | ||
| 31 | { K40, K41, K42, XXX, XXX, K45, XXX, XXX, K48, XXX, K4A, K4B, XXX, K4D, K4E } \ | ||
| 32 | } | ||
| 33 | |||
diff --git a/keyboards/planck/keymaps/rootiest/config.h b/keyboards/planck/keymaps/rootiest/config.h new file mode 100644 index 000000000..fc1fc8176 --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/config.h | |||
| @@ -0,0 +1,146 @@ | |||
| 1 | /* Copyright 2021 Chris Laprade | ||
| 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 | /* | ||
| 20 | * USB/POWER OPTIONS | ||
| 21 | */ | ||
| 22 | // #define USB_MAX_POWER_CONSUMPTION 500 | ||
| 23 | #define USB_SUSPEND_WAKEUP_DELAY 200 | ||
| 24 | #define USB_POLLING_INTERVAL_MS 1 | ||
| 25 | |||
| 26 | /* | ||
| 27 | * MUSIC/AUDIO options | ||
| 28 | */ | ||
| 29 | #ifdef AUDIO_ENABLE | ||
| 30 | # define AUDIO_CLICKY | ||
| 31 | # define MUSIC_MAP | ||
| 32 | # define AUDIO_VOICES | ||
| 33 | # define AUDIO_VOICE_DEFAULT something | ||
| 34 | # define AUDIO_DAC_SAMPLE_MAX 2732U | ||
| 35 | |||
| 36 | # define DEFAULT_LAYER_SONGS \ | ||
| 37 | { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) } | ||
| 38 | |||
| 39 | /* Plays during keyboard startup */ | ||
| 40 | # define STARTUP_SONG SONG(NO_SOUND) | ||
| 41 | |||
| 42 | #endif | ||
| 43 | |||
| 44 | /* | ||
| 45 | * MIDI options | ||
| 46 | */ | ||
| 47 | /* enable basic MIDI features: | ||
| 48 | - MIDI notes can be sent when in Music mode is on | ||
| 49 | */ | ||
| 50 | #define MIDI_BASIC | ||
| 51 | |||
| 52 | /* enable advanced MIDI features: | ||
| 53 | - MIDI notes can be added to the keymap | ||
| 54 | - Octave shift and transpose | ||
| 55 | - Virtual sustain, portamento, and modulation wheel | ||
| 56 | - etc. | ||
| 57 | */ | ||
| 58 | #define MIDI_ADVANCED | ||
| 59 | |||
| 60 | /* | ||
| 61 | * ENCODER options | ||
| 62 | */ | ||
| 63 | #define ENCODER_DIRECTION_FLIP | ||
| 64 | #define ENCODER_RESOLUTION 4 // Define number of stages between detents on encoders | ||
| 65 | #define ENCODERS_PAD_A \ | ||
| 66 | { B12 } | ||
| 67 | #define ENCODERS_PAD_B \ | ||
| 68 | { B13 } | ||
| 69 | |||
| 70 | /* | ||
| 71 | * RGB options | ||
| 72 | */ | ||
| 73 | #ifdef RGBLIGHT_ENABLE | ||
| 74 | # define RGBLIGHT_SLEEP // Allows rgb to sleep when the host/keyboard does | ||
| 75 | # define RGBLIGHT_ANIMATIONS // Enable using rgb animations | ||
| 76 | # define RGBLIGHT_LAYERS // Enable indicating layers using layered rgb assignments | ||
| 77 | # define RGBLIGHT_LAYER_BLINK // Allows rgb layers to be blinked (activate for a set amount of time) | ||
| 78 | # define RGBLIGHT_MAX_LAYERS 32 // Overides the default (8) max number of rgb layers | ||
| 79 | # define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF // Allows rgb layers to work even when rgb is toggled off | ||
| 80 | #endif | ||
| 81 | |||
| 82 | /* | ||
| 83 | * UNICODE options | ||
| 84 | */ | ||
| 85 | #define UNICODE_SELECTED_MODES UC_WINC, UC_LNX, UC_MAC // Define the methods used for in/outputting unicode | ||
| 86 | |||
| 87 | /* | ||
| 88 | * TAP-DANCE options | ||
| 89 | */ | ||
| 90 | #define TAPPING_TERM 250 // Default time allowed before resetting a Tap-Dance combo | ||
| 91 | #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped once again. */ | ||
| 92 | #define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ | ||
| 93 | #define TAPPING_TOGGLE 3 | ||
| 94 | |||
| 95 | /* | ||
| 96 | * LEADER-KEY options | ||
| 97 | */ // Used for on-board chording | ||
| 98 | #define LEADER_PER_KEY_TIMING | ||
| 99 | #define LEADER_TIMEOUT 500 | ||
| 100 | |||
| 101 | /* | ||
| 102 | * COMBO-KEY options | ||
| 103 | */ | ||
| 104 | #define COMBO_COUNT 2 | ||
| 105 | #define COMBO_TERM 300 | ||
| 106 | /* | ||
| 107 | * MACRO per-key options | ||
| 108 | */ | ||
| 109 | #define RETRO_TAPPING_PER_KEY // Control Retro-Tap individually by key | ||
| 110 | #define TAPPING_FORCE_HOLD_PER_KEY // Control Force-Hold individually by key | ||
| 111 | #define IGNORE_MOD_TAP_INTERRUPT_PER_KEY // Control Mod-Tap-Interrupt individually by key | ||
| 112 | #define PERMISSIVE_HOLD_PER_KEY // Control Permissive-Hold individually by key | ||
| 113 | |||
| 114 | #define MK_KINETIC_SPEED // Use kinetic acceleration for mouse-keys | ||
| 115 | |||
| 116 | // Fall-back defines to prevent compile errors if user_song_list is missing | ||
| 117 | #ifndef ZELDA_PUZZLE2 | ||
| 118 | # define ZELDA_PUZZLE2 Q__NOTE(_G5) | ||
| 119 | #endif | ||
| 120 | #ifndef SONIC_RING2 | ||
| 121 | # define SONIC_RING2 E__NOTE(_E6) | ||
| 122 | #endif | ||
| 123 | #ifndef ZELDA_CHEST2 | ||
| 124 | # define ZELDA_CHEST2 Q__NOTE(_G5) | ||
| 125 | #endif | ||
| 126 | #ifndef COIN_SOUND2 | ||
| 127 | # define COIN_SOUND2 E__NOTE(_A5) | ||
| 128 | #endif | ||
| 129 | #ifndef ONE_UP_SOUND2 | ||
| 130 | # define ONE_UP_SOUND2 Q__NOTE(_E6) | ||
| 131 | #endif | ||
| 132 | #ifndef IMPERIAL_MARCH | ||
| 133 | # define IMPERIAL_MARCH HD_NOTE(_A4) | ||
| 134 | #endif | ||
| 135 | #ifndef MARIO_GAMEOVER | ||
| 136 | # define MARIO_GAMEOVER HD_NOTE(_C5) | ||
| 137 | #endif | ||
| 138 | #ifndef LEAD_START_SOUND | ||
| 139 | # define LEAD_START_SOUND E__NOTE(_C5) | ||
| 140 | #endif | ||
| 141 | #ifndef LEAD_SUCCESS_SOUND | ||
| 142 | # define LEAD_SUCCESS_SOUND E__NOTE(_A5), HD_NOTE(_E6), | ||
| 143 | #endif | ||
| 144 | #ifndef LEAD_FAIL_SOUND | ||
| 145 | # define LEAD_FAIL_SOUND E__NOTE(_A5), HD_NOTE(_E4), | ||
| 146 | #endif | ||
diff --git a/keyboards/planck/keymaps/rootiest/keymap.c b/keyboards/planck/keymaps/rootiest/keymap.c new file mode 100644 index 000000000..634bf2829 --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/keymap.c | |||
| @@ -0,0 +1,1928 @@ | |||
| 1 | /* Copyright 2021 Chris Laprade | ||
| 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 "raw_hid.h" | ||
| 19 | #include "print.h" | ||
| 20 | #include "muse.h" | ||
| 21 | |||
| 22 | /* | ||
| 23 | * Define keyboard name to be used by UI. | ||
| 24 | * This allows for using a different name | ||
| 25 | * than the one defined by QMK for your board. | ||
| 26 | */ | ||
| 27 | #define KEEB_MODEL_NAME "The Rootiest BoogieBoard" | ||
| 28 | |||
| 29 | // Give names to the layers so they are easier to reference | ||
| 30 | enum custom_layers { | ||
| 31 | _BASE, | ||
| 32 | _QWERTY = _BASE, | ||
| 33 | _COLEMAK, | ||
| 34 | _DVORAK, | ||
| 35 | _SYMBLS, | ||
| 36 | _RAISE = _SYMBLS, | ||
| 37 | _NUMBRS, | ||
| 38 | _LOWER = _NUMBRS, | ||
| 39 | _PLOVER, | ||
| 40 | _FEATURS, | ||
| 41 | _ADJUST = _FEATURS, | ||
| 42 | _NUMPD, | ||
| 43 | _TABULA, | ||
| 44 | _MOUSY, | ||
| 45 | }; | ||
| 46 | |||
| 47 | #define LOWER MO(_NUMBRS) | ||
| 48 | #define RAISE MO(_SYMBLS) | ||
| 49 | |||
| 50 | // unicode hexes | ||
| 51 | #define UC_DEG UC(0x00B0) // ° | ||
| 52 | #define UC_DEGF UC(0x2109) // ℉ | ||
| 53 | |||
| 54 | // Time (ms) to wait between frames for the wake rgb animation | ||
| 55 | #define WAKE_ANIMATION_TIMER_FREQUENCY 50 | ||
| 56 | |||
| 57 | // Is a display connected | ||
| 58 | // #define USING_OLED_DISPLAY false | ||
| 59 | |||
| 60 | // wait DELAY ms before unregistering media keys | ||
| 61 | #define TAP_CODE_DELAY 10 | ||
| 62 | |||
| 63 | // Modifier remover | ||
| 64 | #define WITHOUT_MODS(...) \ | ||
| 65 | do { \ | ||
| 66 | const uint8_t _real_mods = get_mods(); \ | ||
| 67 | clear_mods(); \ | ||
| 68 | {__VA_ARGS__} set_mods(_real_mods); \ | ||
| 69 | } while (0) | ||
| 70 | |||
| 71 | // A whole boatload of audio "songs" defined for use by the keyboard | ||
| 72 | #ifdef AUDIO_ENABLE | ||
| 73 | float planck_song[][2] = SONG(PLANCK_SOUND); | ||
| 74 | float hello_song[][2] = SONG(ONE_UP_SOUND2); | ||
| 75 | float bye_song[][2] = SONG(GOODBYE_SOUND); | ||
| 76 | float num_song[][2] = SONG(DVORAK_SOUND); | ||
| 77 | float qwerty_song[][2] = SONG(QWERTY_SOUND); | ||
| 78 | float colemak_song[][2] = SONG(COLEMAK_SOUND); | ||
| 79 | float dvorak_song[][2] = SONG(DVORAK_SOUND); | ||
| 80 | float funk_song[][2] = SONG(COLEMAK_SOUND); | ||
| 81 | float workman_song[][2] = SONG(WORKMAN_SOUND); | ||
| 82 | float term_song[][2] = SONG(TERMINAL_SOUND); | ||
| 83 | float lover_song[][2] = SONG(PLOVER_SOUND); | ||
| 84 | float ode_song[][2] = SONG(ODE_TO_JOY); | ||
| 85 | float rock_song[][2] = SONG(ROCK_A_BYE_BABY); | ||
| 86 | float clue_song[][2] = SONG(CLUEBOARD_SOUND); | ||
| 87 | float camp_song[][2] = SONG(CAMPANELLA); | ||
| 88 | float imp_march_song[][2] = SONG(IMPERIAL_MARCH); | ||
| 89 | float gameover_song[][2] = SONG(MARIO_GAMEOVER); | ||
| 90 | float puzzle_song[][2] = SONG(ZELDA_PUZZLE2); | ||
| 91 | float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND); | ||
| 92 | float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND); | ||
| 93 | float slctl_on[][2] = SONG(SCROLL_LOCK_ON_SOUND); | ||
| 94 | float slctl_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND); | ||
| 95 | float slalt_on[][2] = SONG(NUM_LOCK_ON_SOUND); | ||
| 96 | float slalt_off[][2] = SONG(NUM_LOCK_OFF_SOUND); | ||
| 97 | float leader_started[][2] = SONG(LEAD_START_SOUND); | ||
| 98 | float leader_succeed[][2] = SONG(LEAD_SUCCESS_SOUND); | ||
| 99 | float leader_fail[][2] = SONG(LEAD_FAIL_SOUND); | ||
| 100 | float plover_song[][2] = SONG(PLOVER_SOUND); | ||
| 101 | float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); | ||
| 102 | #endif | ||
| 103 | |||
| 104 | // Declare stored memory config | ||
| 105 | typedef union { | ||
| 106 | uint32_t raw; | ||
| 107 | struct { | ||
| 108 | bool do_wakeup_animation : 1; | ||
| 109 | uint8_t rgbcon_tracker : 8; | ||
| 110 | bool do_wakeup_audio : 1; | ||
| 111 | }; | ||
| 112 | } user_config_t; | ||
| 113 | |||
| 114 | user_config_t user_config; | ||
| 115 | |||
| 116 | // Initialize variable holding the binary | ||
| 117 | // representation of active modifiers. | ||
| 118 | uint8_t mod_state = 0; | ||
| 119 | |||
| 120 | // Declare custom keycodes | ||
| 121 | enum custom_keycodes { | ||
| 122 | MO_BASE = SAFE_RANGE, | ||
| 123 | MO_SYMBLS, | ||
| 124 | MO_NUMBRS, | ||
| 125 | MO_FEATURS, | ||
| 126 | QWERTY, | ||
| 127 | COLEMAK, | ||
| 128 | DVORAK, | ||
| 129 | PLOVER, | ||
| 130 | BACKLIT, | ||
| 131 | MUSIC_ON, | ||
| 132 | MUSIC_OFF, | ||
| 133 | EXT_PLV, | ||
| 134 | MY_RGBCON, | ||
| 135 | MY_DEGREES, | ||
| 136 | ALT_TAB, | ||
| 137 | PRINT_WPM_KEY, | ||
| 138 | IRONY, | ||
| 139 | WAKE_ANI_TOG, | ||
| 140 | WAKE_AUD_TOG, | ||
| 141 | DO_RESET, | ||
| 142 | KC_PRVWD, | ||
| 143 | KC_NXTWD, | ||
| 144 | KC_LSTRT, | ||
| 145 | KC_LEND, | ||
| 146 | KC_DLINE, | ||
| 147 | KC_REDO, | ||
| 148 | KC_SAVE, | ||
| 149 | KC_SLCTALL, | ||
| 150 | KC_ALTF4, | ||
| 151 | KC_KILL, | ||
| 152 | KC_LCUT, | ||
| 153 | KC_LCOPY, | ||
| 154 | KC_NXTAB, | ||
| 155 | KC_PRVTAB, | ||
| 156 | }; | ||
| 157 | |||
| 158 | // Declare unicode map array | ||
| 159 | enum unicode_names { BANG, SNEK }; | ||
| 160 | const uint32_t PROGMEM unicode_map[] = { | ||
| 161 | //[UCD_BANG] = 0x203D, // ‽ | ||
| 162 | //[UCD_IRONY] = 0x2E2E, // ⸮ | ||
| 163 | [SNEK] = 0x1F40D, // 🐍 | ||
| 164 | }; | ||
| 165 | |||
| 166 | enum combo_events { ZC_COPY, XV_PASTE }; | ||
| 167 | |||
| 168 | const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; | ||
| 169 | const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; | ||
| 170 | |||
| 171 | combo_t key_combos[COMBO_COUNT] = { | ||
| 172 | [ZC_COPY] = COMBO_ACTION(copy_combo), | ||
| 173 | [XV_PASTE] = COMBO_ACTION(paste_combo), | ||
| 174 | }; | ||
| 175 | |||
| 176 | // Tap Dance key declarations | ||
| 177 | enum { | ||
| 178 | TD_DEG_DEGF, | ||
| 179 | TD_SMILEY, | ||
| 180 | TD_LSHFT_CAPS, | ||
| 181 | TD_LCTL_STICKY, | ||
| 182 | TD_LALT_STICKY, | ||
| 183 | TD_LOWER, | ||
| 184 | TD_RAISE, | ||
| 185 | }; | ||
| 186 | |||
| 187 | // Declare available Tap-Dance states | ||
| 188 | typedef enum { | ||
| 189 | TD_NONE, | ||
| 190 | TD_SINGLE_TAP, | ||
| 191 | TD_DOUBLE_TAP, | ||
| 192 | TD_TRIPLE_TAP, | ||
| 193 | TD_DOUBLE_SINGLE_TAP, | ||
| 194 | TD_SINGLE_HOLD, | ||
| 195 | TD_DOUBLE_HOLD, | ||
| 196 | TD_TRIPLE_HOLD, | ||
| 197 | TD_UNKNOWN, | ||
| 198 | } td_state_t; | ||
| 199 | |||
| 200 | // Tap-Dance struct | ||
| 201 | typedef struct { | ||
| 202 | bool is_press_action; | ||
| 203 | td_state_t state; | ||
| 204 | } td_tap_t; | ||
| 205 | |||
| 206 | // Whether or not to do the wake animation+sound | ||
| 207 | bool do_wake_animation; | ||
| 208 | |||
| 209 | // Variable to keep track of the rgb mode assigned by the RGB_CON key | ||
| 210 | static uint8_t rgbcon_tracker = 0; | ||
| 211 | |||
| 212 | // Used by the on-board WPM tracker | ||
| 213 | char wpm_str[12]; | ||
| 214 | |||
| 215 | // Variables used for the alt-tab key | ||
| 216 | bool is_alt_tab_active = false; | ||
| 217 | uint16_t alt_tab_timer = 0; | ||
| 218 | |||
| 219 | // Variables used by the Irony key | ||
| 220 | #define IRONY_HOLD_DELAY 500 | ||
| 221 | uint16_t irony_pressed_time; | ||
| 222 | bool irony_active = false; | ||
| 223 | bool irony_shifted = false; | ||
| 224 | char irony_str[4] = "⸮"; | ||
| 225 | char bang_str[4] = "‽"; | ||
| 226 | |||
| 227 | // Variables used for the rgb wakeup animation | ||
| 228 | static uint16_t wake_rgb_timer; | ||
| 229 | static uint8_t wake_rgb_count = 0; | ||
| 230 | bool waking_up = false; | ||
| 231 | bool do_wake_audio = false; | ||
| 232 | |||
| 233 | // Muse variables | ||
| 234 | bool muse_mode = false; | ||
| 235 | bool musical_mode = false; | ||
| 236 | uint8_t last_muse_note = 0; | ||
| 237 | uint16_t muse_counter = 0; | ||
| 238 | uint8_t muse_offset = 70; | ||
| 239 | uint16_t muse_tempo = 50; | ||
| 240 | |||
| 241 | // Used by Leader key chords | ||
| 242 | bool did_leader_succeed; | ||
| 243 | LEADER_EXTERNS(); | ||
| 244 | |||
| 245 | // Tap-Dance stuffs, initializing functions that are coded further below | ||
| 246 | td_state_t cur_dance(qk_tap_dance_state_t* state); | ||
| 247 | void sml_finished(qk_tap_dance_state_t* state, void* user_data); | ||
| 248 | void sml_reset(qk_tap_dance_state_t* state, void* user_data); | ||
| 249 | void scap_finished(qk_tap_dance_state_t* state, void* user_data); | ||
| 250 | void scap_reset(qk_tap_dance_state_t* state, void* user_data); | ||
| 251 | void slctl_finished(qk_tap_dance_state_t* state, void* user_data); | ||
| 252 | void slctl_reset(qk_tap_dance_state_t* state, void* user_data); | ||
| 253 | void slalt_finished(qk_tap_dance_state_t* state, void* user_data); | ||
| 254 | void slalt_reset(qk_tap_dance_state_t* state, void* user_data); | ||
| 255 | bool lctl_sticky = false; | ||
| 256 | bool lalt_sticky = false; | ||
| 257 | |||
| 258 | // This function is called when lock indicators (caps-lock led) are changed/toggled/updated | ||
| 259 | bool led_update_user(led_t led_state) { | ||
| 260 | rgblight_set_layer_state(10, led_state.caps_lock); | ||
| 261 | #ifdef AUDIO_ENABLE | ||
| 262 | static uint8_t caps_state = 0; | ||
| 263 | if (caps_state != led_state.caps_lock) { | ||
| 264 | // When the caps-lock led state changes play sounds | ||
| 265 | led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off); | ||
| 266 | caps_state = led_state.caps_lock; | ||
| 267 | } | ||
| 268 | #endif | ||
| 269 | return true; | ||
| 270 | } | ||
| 271 | |||
| 272 | // Define key layout/layers | ||
| 273 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Define all the layers | ||
| 274 | [_BASE] = LAYOUT_planck_mit( // | ||
| 275 | KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, // | ||
| 276 | LT(_TABULA, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, // | ||
| 277 | TD(TD_LSHFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SFTENT, // | ||
| 278 | TD(TD_LCTL_STICKY), KC_LEAD, KC_LGUI, TD(TD_LALT_STICKY), MO(_SYMBLS), KC_SPC, MO(_NUMBRS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), | ||
| 279 | /* | ||
| 280 | Base Layer [0] | ||
| 281 | * ,-----------------------------------------------------------------------------------. | ||
| 282 | * |Gr/ESC| Q | W | E | R | T | Y | U | I | O | P |BckSpc| | ||
| 283 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 284 | * |Tabula| A | S | D | F | G | H | J | K | L | ; | ' | | ||
| 285 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 286 | * |SH/CAP| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
| 287 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 288 | * | LCtrl|Leader| OS | Alt |Symbol| Space |Number| Left | Dwn | Up | Right| | ||
| 289 | * `-----------------------------------------------------------------------------------' | ||
| 290 | */ | ||
| 291 | |||
| 292 | [_COLEMAK] = LAYOUT_planck_mit( // | ||
| 293 | KC_GESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, // | ||
| 294 | LT(_TABULA, KC_TAB), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, // | ||
| 295 | TD(TD_LSHFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_SFTENT, // | ||
| 296 | TD(TD_LCTL_STICKY), KC_LEAD, KC_LGUI, TD(TD_LALT_STICKY), MO(_SYMBLS), KC_SPC, MO(_NUMBRS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), | ||
| 297 | /* | ||
| 298 | Colemak Layer [1] | ||
| 299 | * ,-----------------------------------------------------------------------------------. | ||
| 300 | * |Gr/ESC| Q | W | F | P | G | J | L | U | Y | ; | Bksp | | ||
| 301 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 302 | * |Tabula| A | R | S | T | D | H | N | E | I | O | " | | ||
| 303 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 304 | * |SH/CAP| Z | X | C | V | B | K | M | , | . | / |Enter | | ||
| 305 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 306 | * | LCtrl|Leader| OS | Alt |Symbol| Space |Number| Left | Dwn | Up | Right| | ||
| 307 | * `-----------------------------------------------------------------------------------' | ||
| 308 | */ | ||
| 309 | |||
| 310 | [_DVORAK] = LAYOUT_planck_mit( // | ||
| 311 | KC_GESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, // | ||
| 312 | LT(_TABULA, KC_TAB), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_TRNS, KC_S, KC_SLSH, // | ||
| 313 | TD(TD_LSHFT_CAPS), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SFTENT, // | ||
| 314 | TD(TD_LCTL_STICKY), KC_LEAD, KC_LGUI, TD(TD_LALT_STICKY), MO(_SYMBLS), KC_SPC, MO(_NUMBRS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), | ||
| 315 | /* Dvorak Layer [2] | ||
| 316 | * ,-----------------------------------------------------------------------------------. | ||
| 317 | * |Gr/ESC| " | , | . | P | Y | F | G | C | R | L | Bksp | | ||
| 318 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 319 | * |Tabula| A | O | E | U | I | D | H | T | N | S | / | | ||
| 320 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 321 | * |SH/CAP| ; | Q | J | K | X | B | M | W | V | Z |Enter | | ||
| 322 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 323 | * | LCtrl|Leader| OS | Alt |Symbol| Space |Number| Left | Dwn | Up | Right| | ||
| 324 | * `-----------------------------------------------------------------------------------' | ||
| 325 | */ | ||
| 326 | [_SYMBLS] = LAYOUT_planck_mit( // | ||
| 327 | KC_MPLY, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, // | ||
| 328 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, // | ||
| 329 | KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, LSFT(KC_LCTL), LSFT(KC_LCTL), KC_HOME, KC_END, KC_TRNS, // | ||
| 330 | TG(_NUMPD), KC_TRNS, KC_TRNS, KC_TRNS, TO(_BASE), KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), | ||
| 331 | /* | ||
| 332 | Symbols Layer [3] | ||
| 333 | * ,-----------------------------------------------------------------------------------. | ||
| 334 | * | Play | ! | @ | # | $ | % | ^ | & | * | ( | ) |BckSpc| | ||
| 335 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 336 | * |Delete| F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | ||
| 337 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 338 | * | Shift| F7 | F8 | F9 | F10 | F11 | F12 |LShLCt|LShLCt| Home | End |------| | ||
| 339 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 340 | * | TG(7)|------|------|------| Base | ----- | MO(4)| Next | Vol- | Vol+ | Play | | ||
| 341 | * `-----------------------------------------------------------------------------------' | ||
| 342 | */ | ||
| 343 | |||
| 344 | [_NUMBRS] = LAYOUT_planck_mit( // | ||
| 345 | KC_MPLY, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, // | ||
| 346 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, // | ||
| 347 | KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, KC_TRNS, // | ||
| 348 | TG(_NUMPD), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TO(_BASE), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), | ||
| 349 | |||
| 350 | /* | ||
| 351 | Numbers Layer [4] | ||
| 352 | * ,-----------------------------------------------------------------------------------. | ||
| 353 | * | Play | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |BckSpc| | ||
| 354 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 355 | * |Delete| F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
| 356 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 357 | * | Shift| F7 | F8 | F9 | F10 | F11 | F12 | # | / | PgUp | PgDwn|------| | ||
| 358 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 359 | * | TG(7)|------|------|------| MO(3)| ----- | Base | Next | Vol- | Vol+ | Play | | ||
| 360 | * `-----------------------------------------------------------------------------------' | ||
| 361 | */ | ||
| 362 | |||
| 363 | [_PLOVER] = LAYOUT_planck_mit( // | ||
| 364 | KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, // | ||
| 365 | XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, // | ||
| 366 | XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, // | ||
| 367 | EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX), | ||
| 368 | /* Plover Layer [5] | ||
| 369 | * ,-----------------------------------------------------------------------------------. | ||
| 370 | * | # | # | # | # | # | # | # | # | # | # | # | # | | ||
| 371 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 372 | * | | S | T | P | H | * | * | F | P | L | T | D | | ||
| 373 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 374 | * | | S | K | W | R | * | * | R | B | G | S | Z | | ||
| 375 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 376 | * | Exit | | | A | O | | E | U | | | | | ||
| 377 | * `-----------------------------------------------------------------------------------' | ||
| 378 | */ | ||
| 379 | |||
| 380 | [_FEATURS] = LAYOUT_planck_mit( // | ||
| 381 | LCTL(LALT(KC_DEL)), DO_RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, TD(TD_DEG_DEGF), TD(TD_SMILEY), KC_DEL, // | ||
| 382 | RGB_VAI, RGB_VAD, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, DF(_BASE), DF(_COLEMAK), DF(_DVORAK), TO(_PLOVER), MY_RGBCON, // | ||
| 383 | KC_TRNS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, CK_ON, CK_OFF, KC_ENTER, // | ||
| 384 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(_MOUSY), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | ||
| 385 | /* | ||
| 386 | Special Features Layer [6] | ||
| 387 | * ,-----------------------------------------------------------------------------------. | ||
| 388 | * |C+A+DL| Reset| Debug|RGBTog|RGBMod| Hue+ | Hue- | Sat+ | Sat- |Unicod| Emoji|Delete| | ||
| 389 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 390 | * |RGBVAI|RGBVAD|MU_MOD| AU_ON|AU_OFF|RALTGU|SALTGU| Base |Colemk|Dvorak|Plover|RGBCON| | ||
| 391 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 392 | * |------|MUV_DE|MUV_IN| MU_ON|MU_OFF| MI_ON|MI_OFF|TERMON|TRMOFF|CLK-ON|CLKOFF|Enter | | ||
| 393 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 394 | * |------|------|------|------|------| TG(8) |------|------|------|------|------| | ||
| 395 | * `-----------------------------------------------------------------------------------' | ||
| 396 | */ | ||
| 397 | |||
| 398 | [_NUMPD] = LAYOUT_planck_mit( // | ||
| 399 | KC_ESC, KC_HOME, KC_UP, KC_END, KC_PERC, KC_LCBR, KC_RCBR, KC_TAB, KC_P7, KC_P8, KC_P9, KC_BSPC, // | ||
| 400 | KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSLS, KC_LBRC, KC_RBRC, KC_PSLS, KC_P4, KC_P5, KC_P6, KC_PMNS, // | ||
| 401 | KC_LSFT, KC_SLSH, KC_CUT, KC_COPY, KC_PASTE, KC_LT, KC_GT, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PPLS, // | ||
| 402 | TO(_BASE), KC_LEAD, KC_LGUI, KC_LALT, KC_LCPO, KC_SPC, KC_RCPC, KC_HASH, KC_P0, KC_PDOT, KC_PENT), | ||
| 403 | /* | ||
| 404 | Numpad Layer [7] | ||
| 405 | * ,-----------------------------------------------------------------------------------. | ||
| 406 | * | Esc | Home | Up | End | % | { | } | Tab | 7 | 8 | 9 |BckSpc| | ||
| 407 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 408 | * | ~ | Left | Down | Right| \ | [ | ] | / | 4 | 5 | 6 | - | | ||
| 409 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 410 | * | Shift| / |Ctrl+X|Ctrl+C|Ctrl+V| < | > | * | 1 | 2 | 3 | + | | ||
| 411 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 412 | * | Base |Leader| Alt | OS |LCtl/(| Space |)/RCtl| # | 0 | . |Enter | | ||
| 413 | * `-----------------------------------------------------------------------------------' | ||
| 414 | */ | ||
| 415 | [_TABULA] = LAYOUT_planck_mit( // | ||
| 416 | KC_ESC, KC_ALTF4, VLK_TOG, PRINT_WPM_KEY, WAKE_ANI_TOG, WAKE_AUD_TOG, KC_REDO, UC_MOD, UC_M_WC, CG_TOGG, AG_TOGG, KC_DLINE, // | ||
| 417 | KC_NXTAB, KC_SLCTALL, KC_SAVE, KC_TRNS, KC_FIND, SH_TG, SH_TG, IRONY, KC_LCUT, KC_LCOPY, KC_TRNS, KC_KILL, // | ||
| 418 | KC_LSFT, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_PRVWD, KC_NXTWD, TG(_MOUSY), KC_TRNS, KC_HOME, KC_END, KC_SFTENT, // | ||
| 419 | TO(_BASE), KC_LCTL, KC_LGUI, KC_LALT, KC_LSPO, ALT_TAB, KC_RSPC, KC_PRVWD, KC_BRID, KC_BRIU, KC_NXTWD), | ||
| 420 | /* Tabular Layer [8] | ||
| 421 | * ,-----------------------------------------------------------------------------------. | ||
| 422 | * | Esc |Alt+F4|Veloci| WPM |WakANI|WakAUD|Ctrl+Y|UCMode|UCWinC|CtGUTg|AltGTg| DLine| | ||
| 423 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 424 | * | Tab |Ctrl+A|Ctrl+S|------|Ctrl+F| SWAP | SWAP | ⸮^‽ |CutLin|CpyLin|------|DelLin| | ||
| 425 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 426 | * | Shift|Ctrl+Z|Ctrl+X|Ctrl+C|Ctrl+V|PrVWin|NxtWin| TG(8)|------| Home | End |Enter | | ||
| 427 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 428 | * | Base | LCtrl| Alt | OS |LSft/(| Alt+Tab |)/RSft|PrvSel|ScrBr-|ScrBr+|NxtSel| | ||
| 429 | * `-----------------------------------------------------------------------------------' | ||
| 430 | */ | ||
| 431 | |||
| 432 | [_MOUSY] = LAYOUT_planck_mit( // | ||
| 433 | KC_ESC, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, UC_MOD, UC_M_WC, CG_TOGG, AG_TOGG, KC_BSPC, // | ||
| 434 | KC_TAB, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, IRONY, VLK_TOG, KC_TRNS, KC_TRNS, KC_TRNS, // | ||
| 435 | KC_LSFT, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_PRVWD, KC_NXTWD, KC_TRNS, KC_HOME, KC_BTN3, KC_END, KC_SFTENT, // | ||
| 436 | TO(_BASE), KC_LCTL, KC_LGUI, KC_LALT, KC_BTN1, ALT_TAB, KC_BTN2, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R)}; | ||
| 437 | /* MousePad Layer [9] | ||
| 438 | * ,-----------------------------------------------------------------------------------. | ||
| 439 | * | Esc |MsBtn1| MsUp |MsBtn2|------|------|------|UCMode|UCWinC|CtGUTg|AltGTg|BckSpc| | ||
| 440 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 441 | * | ~ |MsLeft|MsDown|MsRigt|------|------|------| ⸮^‽ |Veloci|------|------|------| | ||
| 442 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 443 | * | Shift|------|Ctrl+X|Ctrl+C|Ctrl+V|------|------|------| Home |MsBtn3| End |Enter | | ||
| 444 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 445 | * | Base | LCtrl| Alt | OS |MsBtn1| Alt+Tab |MsBtn2|MsWhlL|MsWhlD|MsWhlU|MsWhlR| | ||
| 446 | * `-----------------------------------------------------------------------------------' | ||
| 447 | */ | ||
| 448 | |||
| 449 | // Define RGB layers | assign leds and their values for each rgb layer | ||
| 450 | const rgblight_segment_t PROGMEM my_warning_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 9, HSV_RED}, {0, 1, HSV_RED}); | ||
| 451 | const rgblight_segment_t PROGMEM my_allgood_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 9, HSV_GREEN}, {0, 1, HSV_GREEN}); | ||
| 452 | const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_RED}, {8, 1, HSV_RED}); | ||
| 453 | const rgblight_segment_t PROGMEM my_number_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_MAGENTA}, {8, 1, HSV_MAGENTA}); | ||
| 454 | const rgblight_segment_t PROGMEM my_symbol_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_GREEN}, {8, 1, HSV_GREEN}); | ||
| 455 | const rgblight_segment_t PROGMEM my_tabula_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_CORAL}, {1, 1, HSV_CORAL}, {8, 1, HSV_CORAL}); | ||
| 456 | const rgblight_segment_t PROGMEM my_mousy_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_TURQUOISE}, {1, 1, HSV_TURQUOISE}, {8, 1, HSV_TURQUOISE}, {7, 1, HSV_MAGENTA}); | ||
| 457 | const rgblight_segment_t PROGMEM my_numpad_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_GOLD}, {1, 1, HSV_GOLD}, {8, 1, HSV_GOLD}, {7, 1, HSV_BLUE}); | ||
| 458 | const rgblight_segment_t PROGMEM my_features_layer[] = RGBLIGHT_LAYER_SEGMENTS({3, 4, HSV_BLUE}, {1, 1, HSV_BLUE}, {8, 1, HSV_BLUE}); | ||
| 459 | const rgblight_segment_t PROGMEM my_base_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, 0, HSV_BLACK}); | ||
| 460 | const rgblight_segment_t PROGMEM my_colemak_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_GREEN}); | ||
| 461 | const rgblight_segment_t PROGMEM my_dvorak_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_ORANGE}); | ||
| 462 | const rgblight_segment_t PROGMEM my_plover_layer[] = RGBLIGHT_LAYER_SEGMENTS({1, 1, HSV_GOLD}); | ||
| 463 | |||
| 464 | // Define the array of rgb layers. Later layers take precedence | ||
| 465 | const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_base_layer, // Base Layer | ||
| 466 | my_colemak_layer, // Overrides previous layer | ||
| 467 | my_dvorak_layer, // Overrides previous layers | ||
| 468 | my_symbol_layer, // Overrides previous layers | ||
| 469 | my_number_layer, // ...etc my_features_layer, // Overrides layers | ||
| 470 | my_plover_layer, // | ||
| 471 | my_features_layer, // | ||
| 472 | my_numpad_layer, // | ||
| 473 | my_tabula_layer, // | ||
| 474 | my_mousy_layer, // | ||
| 475 | my_capslock_layer, // | ||
| 476 | my_warning_layer, // | ||
| 477 | my_allgood_layer); // CapsLock Layer); | ||
| 478 | |||
| 479 | // Configure encoders | ||
| 480 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
| 481 | if (musical_mode) { | ||
| 482 | if (clockwise) { | ||
| 483 | tap_code16(MU_MOD); | ||
| 484 | } else { | ||
| 485 | tap_code16(MU_MOD); | ||
| 486 | } | ||
| 487 | } else { | ||
| 488 | if (muse_mode) { | ||
| 489 | if (IS_LAYER_ON(_RAISE)) { | ||
| 490 | if (clockwise) { | ||
| 491 | muse_offset++; | ||
| 492 | } else { | ||
| 493 | muse_offset--; | ||
| 494 | } | ||
| 495 | } else { | ||
| 496 | if (clockwise) { | ||
| 497 | muse_tempo += 1; | ||
| 498 | } else { | ||
| 499 | muse_tempo -= 1; | ||
| 500 | } | ||
| 501 | } | ||
| 502 | } else { | ||
| 503 | if (index == 0) { /* First encoder */ | ||
| 504 | uint16_t held_keycode_timer = timer_read(); | ||
| 505 | switch (biton32(layer_state)) { | ||
| 506 | case 0: // Base Layer | ||
| 507 | if ((get_mods() & MOD_MASK_GUI)) { // GUI-ed | ||
| 508 | if (clockwise) { | ||
| 509 | tap_code(KC_RIGHT); | ||
| 510 | |||
| 511 | } else { | ||
| 512 | tap_code(KC_LEFT); | ||
| 513 | } | ||
| 514 | } else if ((get_mods() & MOD_MASK_ALT)) { // Alt-ed | ||
| 515 | if (clockwise) { | ||
| 516 | tap_code16(LALT(KC_TAB)); // Alt+Tabbing | ||
| 517 | } else { | ||
| 518 | tap_code16(LSA(KC_TAB)); | ||
| 519 | } | ||
| 520 | } else if ((get_mods() & MOD_MASK_SHIFT)) { // Shifted | ||
| 521 | const uint8_t _real_mods = get_mods(); | ||
| 522 | unregister_code16(KC_LSFT); | ||
| 523 | unregister_code16(KC_RSFT); | ||
| 524 | clear_mods(); | ||
| 525 | if (clockwise) { | ||
| 526 | tap_code16(KC_MS_WH_DOWN); | ||
| 527 | } else { | ||
| 528 | tap_code16(KC_MS_WH_UP); | ||
| 529 | } | ||
| 530 | set_mods(_real_mods); | ||
| 531 | } else if ((get_mods() & MOD_MASK_CTRL)) { // Ctrl-ed | ||
| 532 | if (clockwise) { | ||
| 533 | tap_code16(RCTL(KC_TAB)); // Ctrl+Tabbing | ||
| 534 | } else { | ||
| 535 | tap_code16(RCS(KC_TAB)); | ||
| 536 | } | ||
| 537 | } else { // Normal or unspecified modifiers | ||
| 538 | if (clockwise) { | ||
| 539 | // Volume control requires extra timer to function correctly | ||
| 540 | register_code(KC_VOLU); | ||
| 541 | while (timer_elapsed(held_keycode_timer) < TAP_CODE_DELAY) { | ||
| 542 | // no-op | ||
| 543 | } | ||
| 544 | unregister_code(KC_VOLD); | ||
| 545 | } else { | ||
| 546 | register_code(KC_VOLD); | ||
| 547 | while (timer_elapsed(held_keycode_timer) < TAP_CODE_DELAY) { | ||
| 548 | // no-op | ||
| 549 | } | ||
| 550 | unregister_code(KC_VOLU); | ||
| 551 | } | ||
| 552 | } | ||
| 553 | return false; | ||
| 554 | break; | ||
| 555 | case 3: // Symbols Layer | ||
| 556 | if (clockwise) { | ||
| 557 | tap_code(KC_WH_D); // Mouse wheeling | ||
| 558 | } else { | ||
| 559 | tap_code(KC_WH_U); | ||
| 560 | } | ||
| 561 | return false; | ||
| 562 | break; | ||
| 563 | case 4: // Numbers Layer | ||
| 564 | if (clockwise) { | ||
| 565 | tap_code(KC_WH_D); // Mouse wheeling | ||
| 566 | } else { | ||
| 567 | tap_code(KC_WH_U); | ||
| 568 | } | ||
| 569 | return false; | ||
| 570 | break; | ||
| 571 | case 6: // Features Layer | ||
| 572 | if (clockwise) { | ||
| 573 | tap_code16(KC_DOWN); | ||
| 574 | } else { | ||
| 575 | tap_code16(KC_UP); | ||
| 576 | } | ||
| 577 | default: // Any other layer | ||
| 578 | if ((get_mods() & MOD_MASK_CSAG)) { | ||
| 579 | if (clockwise) { | ||
| 580 | WITHOUT_MODS({ SEND_STRING(SS_TAP(X_RIGHT)); }); | ||
| 581 | } else { | ||
| 582 | WITHOUT_MODS({ SEND_STRING(SS_TAP(X_LEFT)); }); | ||
| 583 | } | ||
| 584 | } else { | ||
| 585 | if (clockwise) { | ||
| 586 | tap_code(KC_DOWN); // Simple Up/Down | ||
| 587 | } else { | ||
| 588 | tap_code(KC_UP); | ||
| 589 | } | ||
| 590 | } | ||
| 591 | return false; | ||
| 592 | break; | ||
| 593 | } | ||
| 594 | } else if (index == 1) { /* Second encoder (if we had one) */ | ||
| 595 | if (clockwise) { | ||
| 596 | tap_code16(LCTL(KC_LEFT)); // Ctrl+Left/Right | ||
| 597 | } else { | ||
| 598 | tap_code16(LCTL(KC_RIGHT)); | ||
| 599 | } | ||
| 600 | } | ||
| 601 | } | ||
| 602 | } | ||
| 603 | return true; | ||
| 604 | } | ||
| 605 | |||
| 606 | // OLED CONFIGURATION | ||
| 607 | /* | ||
| 608 | static void render_logo(void) { | ||
| 609 | static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; | ||
| 610 | |||
| 611 | oled_write_P(qmk_logo, false); | ||
| 612 | } | ||
| 613 | */ | ||
| 614 | |||
| 615 | // Process Combo events | ||
| 616 | void process_combo_event(uint16_t combo_index, bool pressed) { | ||
| 617 | switch (combo_index) { | ||
| 618 | case ZC_COPY: | ||
| 619 | if (pressed) { | ||
| 620 | tap_code16(LCTL(KC_C)); | ||
| 621 | } | ||
| 622 | break; | ||
| 623 | case XV_PASTE: | ||
| 624 | if (pressed) { | ||
| 625 | tap_code16(LCTL(KC_V)); | ||
| 626 | } | ||
| 627 | break; | ||
| 628 | } | ||
| 629 | } | ||
| 630 | |||
| 631 | // Runs every time a key is pressed or released | ||
| 632 | bool process_record_user(uint16_t keycode, keyrecord_t* record) { | ||
| 633 | #ifdef CONSOLE_ENABLE | ||
| 634 | dprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); | ||
| 635 | #endif | ||
| 636 | // Store the current modifier state in the variable for later reference | ||
| 637 | mod_state = get_mods(); | ||
| 638 | switch (keycode) { | ||
| 639 | case QWERTY: | ||
| 640 | if (record->event.pressed) { | ||
| 641 | set_single_persistent_default_layer(_QWERTY); | ||
| 642 | PLAY_SONG(qwerty_song); | ||
| 643 | } | ||
| 644 | return false; | ||
| 645 | break; | ||
| 646 | case COLEMAK: | ||
| 647 | if (record->event.pressed) { | ||
| 648 | set_single_persistent_default_layer(_COLEMAK); | ||
| 649 | PLAY_SONG(colemak_song); | ||
| 650 | } | ||
| 651 | return false; | ||
| 652 | break; | ||
| 653 | case DVORAK: | ||
| 654 | if (record->event.pressed) { | ||
| 655 | set_single_persistent_default_layer(_DVORAK); | ||
| 656 | PLAY_SONG(dvorak_song); | ||
| 657 | } | ||
| 658 | return false; | ||
| 659 | break; | ||
| 660 | case PLOVER: | ||
| 661 | if (record->event.pressed) { | ||
| 662 | #ifdef AUDIO_ENABLE | ||
| 663 | stop_all_notes(); | ||
| 664 | PLAY_SONG(plover_song); | ||
| 665 | #endif | ||
| 666 | layer_off(_RAISE); | ||
| 667 | layer_off(_LOWER); | ||
| 668 | layer_off(_ADJUST); | ||
| 669 | layer_on(_PLOVER); | ||
| 670 | if (!eeconfig_is_enabled()) { | ||
| 671 | eeconfig_init(); | ||
| 672 | } | ||
| 673 | keymap_config.raw = eeconfig_read_keymap(); | ||
| 674 | keymap_config.nkro = 1; | ||
| 675 | eeconfig_update_keymap(keymap_config.raw); | ||
| 676 | } | ||
| 677 | return false; | ||
| 678 | break; | ||
| 679 | case EXT_PLV: | ||
| 680 | if (record->event.pressed) { | ||
| 681 | #ifdef AUDIO_ENABLE | ||
| 682 | PLAY_SONG(plover_gb_song); | ||
| 683 | #endif | ||
| 684 | layer_off(_PLOVER); | ||
| 685 | } | ||
| 686 | return false; | ||
| 687 | break; | ||
| 688 | case MO_SYMBLS: | ||
| 689 | if (record->event.pressed) { | ||
| 690 | layer_on(_SYMBLS); | ||
| 691 | } else { | ||
| 692 | layer_off(_SYMBLS); | ||
| 693 | } | ||
| 694 | return false; | ||
| 695 | case MO_NUMBRS: | ||
| 696 | if (record->event.pressed) { | ||
| 697 | layer_on(_NUMBRS); | ||
| 698 | } else { | ||
| 699 | layer_off(_NUMBRS); | ||
| 700 | } | ||
| 701 | return false; | ||
| 702 | case MO_FEATURS: | ||
| 703 | if (record->event.pressed) { | ||
| 704 | layer_on(_FEATURS); | ||
| 705 | } else { | ||
| 706 | layer_off(_FEATURS); | ||
| 707 | } | ||
| 708 | return false; | ||
| 709 | case MUSIC_ON: | ||
| 710 | if (record->event.pressed) { | ||
| 711 | musical_mode = true; | ||
| 712 | register_code16(MU_ON); | ||
| 713 | } else { | ||
| 714 | unregister_code16(MU_ON); | ||
| 715 | } | ||
| 716 | break; | ||
| 717 | case MUSIC_OFF: | ||
| 718 | if (record->event.pressed) { | ||
| 719 | musical_mode = false; | ||
| 720 | register_code16(MU_OFF); | ||
| 721 | } else { | ||
| 722 | unregister_code16(MU_OFF); | ||
| 723 | } | ||
| 724 | break; | ||
| 725 | case KC_PRVWD: // Control+Left | ||
| 726 | if (record->event.pressed) { | ||
| 727 | if (keymap_config.swap_lctl_lgui) { | ||
| 728 | register_mods(mod_config(MOD_LALT)); | ||
| 729 | register_code(KC_LEFT); | ||
| 730 | } else { | ||
| 731 | register_mods(mod_config(MOD_LCTL)); | ||
| 732 | register_code(KC_LEFT); | ||
| 733 | } | ||
| 734 | } else { | ||
| 735 | if (keymap_config.swap_lctl_lgui) { | ||
| 736 | unregister_mods(mod_config(MOD_LALT)); | ||
| 737 | unregister_code(KC_LEFT); | ||
| 738 | } else { | ||
| 739 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 740 | unregister_code(KC_LEFT); | ||
| 741 | } | ||
| 742 | } | ||
| 743 | break; | ||
| 744 | case KC_NXTWD: // Control+Right | ||
| 745 | if (record->event.pressed) { | ||
| 746 | if (keymap_config.swap_lctl_lgui) { | ||
| 747 | register_mods(mod_config(MOD_LALT)); | ||
| 748 | register_code(KC_RIGHT); | ||
| 749 | } else { | ||
| 750 | register_mods(mod_config(MOD_LCTL)); | ||
| 751 | register_code(KC_RIGHT); | ||
| 752 | } | ||
| 753 | } else { | ||
| 754 | if (keymap_config.swap_lctl_lgui) { | ||
| 755 | unregister_mods(mod_config(MOD_LALT)); | ||
| 756 | unregister_code(KC_RIGHT); | ||
| 757 | } else { | ||
| 758 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 759 | unregister_code(KC_RIGHT); | ||
| 760 | } | ||
| 761 | } | ||
| 762 | break; | ||
| 763 | case KC_PRVTAB: // Control+Shift+Tab | ||
| 764 | if (record->event.pressed) { | ||
| 765 | register_mods(mod_config(MOD_LCTL)); | ||
| 766 | register_mods(mod_config(MOD_LSFT)); | ||
| 767 | register_code(KC_TAB); | ||
| 768 | } else { | ||
| 769 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 770 | unregister_mods(mod_config(MOD_LSFT)); | ||
| 771 | unregister_code(KC_TAB); | ||
| 772 | } | ||
| 773 | break; | ||
| 774 | case KC_NXTAB: // Control+Tab | ||
| 775 | if (record->event.pressed) { | ||
| 776 | if (keymap_config.swap_lctl_lgui) { | ||
| 777 | register_mods(mod_config(MOD_LCTL)); | ||
| 778 | register_code(KC_TAB); | ||
| 779 | } else { | ||
| 780 | register_mods(mod_config(MOD_LSFT)); | ||
| 781 | register_code(KC_TAB); | ||
| 782 | } | ||
| 783 | } else { | ||
| 784 | if (keymap_config.swap_lctl_lgui) { | ||
| 785 | unregister_mods(mod_config(MOD_LALT)); | ||
| 786 | unregister_code(KC_RIGHT); | ||
| 787 | } else { | ||
| 788 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 789 | unregister_code(KC_RIGHT); | ||
| 790 | } | ||
| 791 | } | ||
| 792 | break; | ||
| 793 | case KC_LSTRT: // Basically just Home | ||
| 794 | if (record->event.pressed) { | ||
| 795 | if (keymap_config.swap_lctl_lgui) { | ||
| 796 | // CMD-arrow on Mac, but we have CTL and GUI swapped | ||
| 797 | register_mods(mod_config(MOD_LCTL)); | ||
| 798 | register_code(KC_LEFT); | ||
| 799 | } else { | ||
| 800 | register_code(KC_HOME); | ||
| 801 | } | ||
| 802 | } else { | ||
| 803 | if (keymap_config.swap_lctl_lgui) { | ||
| 804 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 805 | unregister_code(KC_LEFT); | ||
| 806 | } else { | ||
| 807 | unregister_code(KC_HOME); | ||
| 808 | } | ||
| 809 | } | ||
| 810 | break; | ||
| 811 | case KC_LEND: // Basically just End | ||
| 812 | if (record->event.pressed) { | ||
| 813 | if (keymap_config.swap_lctl_lgui) { | ||
| 814 | // CMD-arrow on Mac, but we have CTL and GUI swapped | ||
| 815 | register_mods(mod_config(MOD_LCTL)); | ||
| 816 | register_code(KC_RIGHT); | ||
| 817 | } else { | ||
| 818 | register_code(KC_END); | ||
| 819 | } | ||
| 820 | } else { | ||
| 821 | if (keymap_config.swap_lctl_lgui) { | ||
| 822 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 823 | unregister_code(KC_RIGHT); | ||
| 824 | } else { | ||
| 825 | unregister_code(KC_END); | ||
| 826 | } | ||
| 827 | } | ||
| 828 | break; | ||
| 829 | case KC_DLINE: // Control+BackSpace | ||
| 830 | if (record->event.pressed) { | ||
| 831 | register_mods(mod_config(MOD_LCTL)); | ||
| 832 | register_code(KC_BSPC); | ||
| 833 | } else { | ||
| 834 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 835 | unregister_code(KC_BSPC); | ||
| 836 | } | ||
| 837 | break; | ||
| 838 | case KC_COPY: // Copy: Control+C | ||
| 839 | if (record->event.pressed) { | ||
| 840 | register_mods(mod_config(MOD_LCTL)); | ||
| 841 | register_code(KC_C); | ||
| 842 | } else { | ||
| 843 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 844 | unregister_code(KC_C); | ||
| 845 | } | ||
| 846 | return false; | ||
| 847 | case KC_PASTE: // Paste: Control+V | ||
| 848 | if (record->event.pressed) { | ||
| 849 | register_mods(mod_config(MOD_LCTL)); | ||
| 850 | register_code(KC_V); | ||
| 851 | } else { | ||
| 852 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 853 | unregister_code(KC_V); | ||
| 854 | } | ||
| 855 | return false; | ||
| 856 | case KC_CUT: // Cut: Control+X | ||
| 857 | if (record->event.pressed) { | ||
| 858 | register_mods(mod_config(MOD_LCTL)); | ||
| 859 | register_code(KC_X); | ||
| 860 | } else { | ||
| 861 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 862 | unregister_code(KC_X); | ||
| 863 | } | ||
| 864 | return false; | ||
| 865 | break; | ||
| 866 | case KC_UNDO: // Undo: Control+Z | ||
| 867 | if (record->event.pressed) { | ||
| 868 | register_mods(mod_config(MOD_LCTL)); | ||
| 869 | register_code(KC_Z); | ||
| 870 | } else { | ||
| 871 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 872 | unregister_code(KC_Z); | ||
| 873 | } | ||
| 874 | return false; | ||
| 875 | case KC_REDO: // Redo: Control+Y | ||
| 876 | if (record->event.pressed) { | ||
| 877 | register_mods(mod_config(MOD_LCTL)); | ||
| 878 | register_code(KC_Y); | ||
| 879 | } else { | ||
| 880 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 881 | unregister_code(KC_Y); | ||
| 882 | } | ||
| 883 | break; | ||
| 884 | case KC_SAVE: // Save: Control+S | ||
| 885 | if (record->event.pressed) { | ||
| 886 | register_mods(mod_config(MOD_LCTL)); | ||
| 887 | register_code(KC_S); | ||
| 888 | } else { | ||
| 889 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 890 | unregister_code(KC_S); | ||
| 891 | } | ||
| 892 | return false; | ||
| 893 | case KC_FIND: // Find: Control+F | ||
| 894 | if (record->event.pressed) { | ||
| 895 | register_mods(mod_config(MOD_LCTL)); | ||
| 896 | register_code(KC_F); | ||
| 897 | } else { | ||
| 898 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 899 | unregister_code(KC_F); | ||
| 900 | } | ||
| 901 | return false; | ||
| 902 | case KC_SLCTALL: // Select All: Control+A | ||
| 903 | if (record->event.pressed) { | ||
| 904 | register_mods(mod_config(MOD_LCTL)); | ||
| 905 | register_code(KC_A); | ||
| 906 | } else { | ||
| 907 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 908 | unregister_code(KC_A); | ||
| 909 | } | ||
| 910 | return false; | ||
| 911 | case KC_KILL: // Kill: Delete Line | ||
| 912 | if (record->event.pressed) { | ||
| 913 | tap_code(KC_HOME); | ||
| 914 | register_mods(mod_config(MOD_LSFT)); | ||
| 915 | tap_code(KC_END); | ||
| 916 | unregister_mods(mod_config(MOD_LSFT)); | ||
| 917 | tap_code(KC_DELETE); | ||
| 918 | } else { | ||
| 919 | } | ||
| 920 | return false; | ||
| 921 | case KC_LCUT: // Cut Line | ||
| 922 | if (record->event.pressed) { | ||
| 923 | tap_code(KC_HOME); | ||
| 924 | register_mods(mod_config(MOD_LSFT)); | ||
| 925 | tap_code(KC_END); | ||
| 926 | unregister_mods(mod_config(MOD_LSFT)); | ||
| 927 | register_mods(mod_config(MOD_LCTL)); | ||
| 928 | tap_code(KC_X); | ||
| 929 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 930 | } else { | ||
| 931 | } | ||
| 932 | return false; | ||
| 933 | case KC_LCOPY: // Copy Line | ||
| 934 | if (record->event.pressed) { | ||
| 935 | tap_code(KC_HOME); | ||
| 936 | register_mods(mod_config(MOD_LSFT)); | ||
| 937 | tap_code(KC_END); | ||
| 938 | unregister_mods(mod_config(MOD_LSFT)); | ||
| 939 | register_mods(mod_config(MOD_LCTL)); | ||
| 940 | tap_code(KC_C); | ||
| 941 | unregister_mods(mod_config(MOD_LCTL)); | ||
| 942 | tap_code(KC_END); | ||
| 943 | } else { | ||
| 944 | } | ||
| 945 | return false; | ||
| 946 | case KC_ALTF4: // Close Window: Alt+F4 | ||
| 947 | if (record->event.pressed) { | ||
| 948 | register_mods(mod_config(MOD_LALT)); | ||
| 949 | register_code(KC_F4); | ||
| 950 | } else { | ||
| 951 | unregister_mods(mod_config(MOD_LALT)); | ||
| 952 | unregister_code(KC_F4); | ||
| 953 | } | ||
| 954 | return false; | ||
| 955 | case ALT_TAB: // Change Window: Super ⭍ Alt+Tab | ||
| 956 | if (record->event.pressed) { | ||
| 957 | if (!is_alt_tab_active) { | ||
| 958 | is_alt_tab_active = true; | ||
| 959 | register_code(KC_LALT); | ||
| 960 | } | ||
| 961 | alt_tab_timer = timer_read(); | ||
| 962 | register_code(KC_TAB); | ||
| 963 | #ifdef CONSOLE_ENABLE | ||
| 964 | dprint("I've tabbed to another window!\n"); | ||
| 965 | #endif | ||
| 966 | } else { | ||
| 967 | unregister_code(KC_TAB); | ||
| 968 | } | ||
| 969 | break; | ||
| 970 | case KC_BSPC: { | ||
| 971 | // Initialize a boolean variable that keeps track | ||
| 972 | // of the delete key status: registered or not? | ||
| 973 | static bool delkey_registered; | ||
| 974 | if (record->event.pressed) { | ||
| 975 | // Detect the activation of either shift keys | ||
| 976 | if (mod_state & MOD_MASK_SHIFT) { | ||
| 977 | // First temporarily canceling both shifts so that | ||
| 978 | // shift isn't applied to the KC_DEL keycode | ||
| 979 | del_mods(MOD_MASK_SHIFT); | ||
| 980 | register_code(KC_DEL); | ||
| 981 | // Update the boolean variable to reflect the status of KC_DEL | ||
| 982 | delkey_registered = true; | ||
| 983 | // Reapplying modifier state so that the held shift key(s) | ||
| 984 | // still work even after having tapped the Backspace/Delete key. | ||
| 985 | set_mods(mod_state); | ||
| 986 | return false; | ||
| 987 | } | ||
| 988 | } else { // on release of KC_BSPC | ||
| 989 | // In case KC_DEL is still being sent even after the release of KC_BSPC | ||
| 990 | if (delkey_registered) { | ||
| 991 | unregister_code(KC_DEL); | ||
| 992 | delkey_registered = false; | ||
| 993 | return false; | ||
| 994 | } | ||
| 995 | } | ||
| 996 | } | ||
| 997 | // Let QMK process the KC_BSPC keycode as usual outside of shift | ||
| 998 | return true; | ||
| 999 | |||
| 1000 | case DO_RESET: // Reset button with LED indication | ||
| 1001 | if (record->event.pressed) { | ||
| 1002 | rgblight_set_effect_range(0, 9); | ||
| 1003 | rgblight_sethsv_noeeprom(HSV_RED); | ||
| 1004 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 1005 | rgblight_blink_layer(11, 5000); | ||
| 1006 | reset_keyboard(); | ||
| 1007 | } | ||
| 1008 | break; | ||
| 1009 | case WAKE_ANI_TOG: // Toggle the Wakeup RGB animation | ||
| 1010 | if (record->event.pressed) { | ||
| 1011 | user_config.do_wakeup_animation ^= 1; // Toggles the status | ||
| 1012 | eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM | ||
| 1013 | if (user_config.do_wakeup_animation) { | ||
| 1014 | print("Wake animation enabled.\n"); | ||
| 1015 | PLAY_SONG(slctl_on); | ||
| 1016 | |||
| 1017 | } else { | ||
| 1018 | print("Wake animation disabled.\n"); | ||
| 1019 | PLAY_SONG(slctl_off); | ||
| 1020 | } | ||
| 1021 | } | ||
| 1022 | break; | ||
| 1023 | case WAKE_AUD_TOG: // Toggle the wake-up music | ||
| 1024 | if (record->event.pressed) { | ||
| 1025 | user_config.do_wakeup_audio ^= 1; // Toggles the status | ||
| 1026 | eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM | ||
| 1027 | if (user_config.do_wakeup_audio) { | ||
| 1028 | print("Wake music enabled.\n"); | ||
| 1029 | PLAY_SONG(slctl_on); | ||
| 1030 | |||
| 1031 | } else { | ||
| 1032 | print("Wake music disabled.\n"); | ||
| 1033 | PLAY_SONG(slctl_off); | ||
| 1034 | } | ||
| 1035 | } | ||
| 1036 | break; | ||
| 1037 | case IRONY: // Outputs Irony/Interrobang symbols | ||
| 1038 | if ((get_mods() & MOD_MASK_SHIFT)) { | ||
| 1039 | irony_shifted = true; | ||
| 1040 | } else { | ||
| 1041 | irony_shifted = false; | ||
| 1042 | } | ||
| 1043 | if (record->event.pressed) { | ||
| 1044 | if (irony_shifted) { | ||
| 1045 | send_unicode_string(bang_str); | ||
| 1046 | } else { | ||
| 1047 | send_unicode_string(irony_str); | ||
| 1048 | } | ||
| 1049 | irony_active = true; | ||
| 1050 | irony_pressed_time = timer_read(); | ||
| 1051 | } else { | ||
| 1052 | irony_active = false; | ||
| 1053 | irony_pressed_time = 0; | ||
| 1054 | irony_shifted = false; | ||
| 1055 | } | ||
| 1056 | return false; | ||
| 1057 | case TG(_NUMPD): // Toggle the NumPad layer | ||
| 1058 | if (record->event.pressed) { | ||
| 1059 | #ifdef AUDIO_ENABLE | ||
| 1060 | PLAY_SONG(hello_song); | ||
| 1061 | #endif | ||
| 1062 | print("I've activated the NumPad!\n"); | ||
| 1063 | } else { | ||
| 1064 | } | ||
| 1065 | break; | ||
| 1066 | case TG(_TABULA): // Toggle the Tabula layer | ||
| 1067 | if (record->event.pressed) { | ||
| 1068 | #ifdef AUDIO_ENABLE | ||
| 1069 | PLAY_SONG(lover_song); | ||
| 1070 | #endif | ||
| 1071 | print("I've activated Tabular!\n"); | ||
| 1072 | } else { | ||
| 1073 | } | ||
| 1074 | break; | ||
| 1075 | case TG(_MOUSY): // Toggle the MouseyPad layer | ||
| 1076 | if (record->event.pressed) { | ||
| 1077 | #ifdef AUDIO_ENABLE | ||
| 1078 | PLAY_SONG(funk_song); | ||
| 1079 | #endif | ||
| 1080 | print("I've activated the MousePad!\n"); | ||
| 1081 | } else { | ||
| 1082 | } | ||
| 1083 | break; | ||
| 1084 | case TO(_BASE): // Return to the base layer | ||
| 1085 | if (record->event.pressed) { | ||
| 1086 | #ifdef AUDIO_ENABLE | ||
| 1087 | PLAY_SONG(planck_song); | ||
| 1088 | #endif | ||
| 1089 | print("I've returned to the Base Layer!\n"); | ||
| 1090 | } else { | ||
| 1091 | } | ||
| 1092 | break; | ||
| 1093 | case PRINT_WPM_KEY: // Prints the current average words-per-minute to the console | ||
| 1094 | sprintf(wpm_str, "Current WPM: %hu", get_current_wpm()); | ||
| 1095 | printf("%s\n", wpm_str); | ||
| 1096 | break; | ||
| 1097 | |||
| 1098 | case MY_RGBCON: // Cycles through custom RGB animation presets | ||
| 1099 | if (record->event.pressed) { | ||
| 1100 | // when keycode RGB-CON is pressed | ||
| 1101 | user_config.rgbcon_tracker = rgbcon_tracker + 1; // Toggles the status | ||
| 1102 | eeconfig_update_user(user_config.raw); | ||
| 1103 | switch (rgbcon_tracker) { | ||
| 1104 | case 0: | ||
| 1105 | rgblight_set_effect_range(0, 9); | ||
| 1106 | rgblight_sethsv(HSV_BLACK); | ||
| 1107 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 1108 | print("Changed RGB mode to: Disabled RGB\n"); | ||
| 1109 | rgbcon_tracker++; | ||
| 1110 | break; | ||
| 1111 | case 1: | ||
| 1112 | rgblight_set_effect_range(0, 9); | ||
| 1113 | rgblight_sethsv(HSV_WHITE); | ||
| 1114 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 1115 | print("Changed RGB mode to: Static White\n"); | ||
| 1116 | rgbcon_tracker++; | ||
| 1117 | break; | ||
| 1118 | case 2: | ||
| 1119 | rgblight_set_effect_range(0, 9); | ||
| 1120 | rgblight_sethsv(HSV_CYAN); | ||
| 1121 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 1122 | print("Changed RGB mode to: Static Cyan\n"); | ||
| 1123 | rgbcon_tracker++; | ||
| 1124 | break; | ||
| 1125 | case 3: | ||
| 1126 | rgblight_set_effect_range(0, 9); | ||
| 1127 | rgblight_sethsv(HSV_WHITE); | ||
| 1128 | rgblight_mode(RGBLIGHT_MODE_BREATHING); | ||
| 1129 | print("Changed RGB mode to: Breathing Lights\n"); | ||
| 1130 | #ifdef AUDIO_ENABLE | ||
| 1131 | print("Played Marching song!\n"); | ||
| 1132 | PLAY_SONG(imp_march_song); | ||
| 1133 | #endif | ||
| 1134 | rgbcon_tracker++; | ||
| 1135 | break; | ||
| 1136 | case 4: | ||
| 1137 | rgblight_set_effect_range(0, 9); | ||
| 1138 | rgblight_sethsv(HSV_RED); | ||
| 1139 | rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); | ||
| 1140 | print("Changed RGB mode to: Rainbow Swirl\n"); | ||
| 1141 | rgbcon_tracker++; | ||
| 1142 | break; | ||
| 1143 | case 5: | ||
| 1144 | rgblight_set_effect_range(0, 9); | ||
| 1145 | rgblight_sethsv(HSV_CYAN); | ||
| 1146 | rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD); | ||
| 1147 | print("Changed RGB mode to: Rainbow Mood\n"); | ||
| 1148 | #ifdef AUDIO_ENABLE | ||
| 1149 | print("Played Game Over song!\n"); | ||
| 1150 | PLAY_SONG(gameover_song); | ||
| 1151 | #endif | ||
| 1152 | rgbcon_tracker = 0; | ||
| 1153 | break; | ||
| 1154 | case 6: | ||
| 1155 | rgblight_set_effect_range(0, 9); | ||
| 1156 | rgblight_sethsv(HSV_BLACK); | ||
| 1157 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 1158 | print("Changed RGB mode to: Disabled RGB\n"); | ||
| 1159 | rgbcon_tracker = 1; | ||
| 1160 | break; | ||
| 1161 | } | ||
| 1162 | } else { | ||
| 1163 | } | ||
| 1164 | break; | ||
| 1165 | } | ||
| 1166 | return true; | ||
| 1167 | }; | ||
| 1168 | |||
| 1169 | // Runs *after* a key is pressed | ||
| 1170 | void post_process_record_user(uint16_t keycode, keyrecord_t* record) { | ||
| 1171 | switch (keycode) { | ||
| 1172 | case DEBUG: | ||
| 1173 | // Blink the warning layer when the debug key is pressed | ||
| 1174 | rgblight_blink_layer_repeat(debug_enable ? 11 : 12, 1500, 3); | ||
| 1175 | |||
| 1176 | // Update the console with the debug mode status | ||
| 1177 | if (debug_enable) { | ||
| 1178 | print("Debug mode enabled.\n"); | ||
| 1179 | PLAY_SONG(slctl_on); | ||
| 1180 | |||
| 1181 | } else { | ||
| 1182 | print("Debug mode disabled.\n"); | ||
| 1183 | PLAY_SONG(slctl_off); | ||
| 1184 | } | ||
| 1185 | break; | ||
| 1186 | } | ||
| 1187 | } | ||
| 1188 | |||
| 1189 | // RGB Default Layer assignments | ||
| 1190 | layer_state_t default_layer_state_set_user(layer_state_t state) { | ||
| 1191 | state = update_tri_layer_state(state, _SYMBLS, _NUMBRS, _FEATURS); | ||
| 1192 | |||
| 1193 | // Sets the default RGB layer states | ||
| 1194 | rgblight_set_layer_state(0, layer_state_cmp(state, _BASE)); | ||
| 1195 | rgblight_set_layer_state(1, layer_state_cmp(state, _COLEMAK)); | ||
| 1196 | rgblight_set_layer_state(2, layer_state_cmp(state, _DVORAK)); | ||
| 1197 | return state; | ||
| 1198 | } | ||
| 1199 | |||
| 1200 | // RGB Layer assignments | ||
| 1201 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 1202 | state = update_tri_layer_state(state, _SYMBLS, _NUMBRS, _FEATURS); | ||
| 1203 | |||
| 1204 | // Sets the RGB layer states | ||
| 1205 | rgblight_set_layer_state(5, layer_state_cmp(state, _PLOVER)); | ||
| 1206 | rgblight_set_layer_state(6, layer_state_cmp(state, _FEATURS)); | ||
| 1207 | rgblight_set_layer_state(3, layer_state_cmp(state, _SYMBLS)); | ||
| 1208 | rgblight_set_layer_state(4, layer_state_cmp(state, _NUMBRS)); | ||
| 1209 | rgblight_set_layer_state(7, layer_state_cmp(state, _NUMPD)); | ||
| 1210 | rgblight_set_layer_state(8, layer_state_cmp(state, _TABULA)); | ||
| 1211 | rgblight_set_layer_state(9, layer_state_cmp(state, _MOUSY)); | ||
| 1212 | return state; | ||
| 1213 | } | ||
| 1214 | |||
| 1215 | // Runs the wakeup rgb animation + music | ||
| 1216 | void rgb_wakeup_sequence(void) { | ||
| 1217 | if (waking_up) { | ||
| 1218 | if ((timer_elapsed(wake_rgb_timer) > WAKE_ANIMATION_TIMER_FREQUENCY)) { | ||
| 1219 | if (wake_rgb_count < 1) { | ||
| 1220 | rgblight_sethsv_noeeprom(HSV_OFF); | ||
| 1221 | rgblight_set_effect_range(0, 9); | ||
| 1222 | } else if (wake_rgb_count < 2 && wake_rgb_count > 0) { | ||
| 1223 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1224 | rgblight_set_effect_range(0, 2); | ||
| 1225 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1226 | rgblight_set_effect_range(2, 9); | ||
| 1227 | } else if (wake_rgb_count < 3 && wake_rgb_count > 1) { | ||
| 1228 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1229 | rgblight_set_effect_range(0, 2); | ||
| 1230 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1231 | rgblight_set_effect_range(2, 9); | ||
| 1232 | } else if (wake_rgb_count < 4 && wake_rgb_count > 2) { | ||
| 1233 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1234 | rgblight_set_effect_range(0, 3); | ||
| 1235 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1236 | rgblight_set_effect_range(3, 9); | ||
| 1237 | } else if (wake_rgb_count < 5 && wake_rgb_count > 3) { | ||
| 1238 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1239 | rgblight_set_effect_range(0, 4); | ||
| 1240 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1241 | rgblight_set_effect_range(4, 9); | ||
| 1242 | } else if (wake_rgb_count < 6 && wake_rgb_count > 4) { | ||
| 1243 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1244 | rgblight_set_effect_range(0, 5); | ||
| 1245 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1246 | rgblight_set_effect_range(5, 9); | ||
| 1247 | } else if (wake_rgb_count < 7 && wake_rgb_count > 5) { | ||
| 1248 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1249 | rgblight_set_effect_range(0, 6); | ||
| 1250 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1251 | rgblight_set_effect_range(6, 9); | ||
| 1252 | } else if (wake_rgb_count < 8 && wake_rgb_count > 6) { | ||
| 1253 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1254 | rgblight_set_effect_range(0, 7); | ||
| 1255 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1256 | rgblight_set_effect_range(7, 9); | ||
| 1257 | } else if (wake_rgb_count < 9 && wake_rgb_count > 7) { | ||
| 1258 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1259 | rgblight_set_effect_range(0, 8); | ||
| 1260 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1261 | rgblight_set_effect_range(8, 9); | ||
| 1262 | } else if (wake_rgb_count < 10 && wake_rgb_count > 8) { | ||
| 1263 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1264 | rgblight_set_effect_range(0, 0); | ||
| 1265 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1266 | rgblight_set_effect_range(0, 9); | ||
| 1267 | } else if (wake_rgb_count < 11 && wake_rgb_count > 9) { | ||
| 1268 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1269 | rgblight_set_effect_range(0, 8); | ||
| 1270 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1271 | rgblight_set_effect_range(8, 9); | ||
| 1272 | } else if (wake_rgb_count < 12 && wake_rgb_count > 10) { | ||
| 1273 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1274 | rgblight_set_effect_range(0, 7); | ||
| 1275 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1276 | rgblight_set_effect_range(7, 9); | ||
| 1277 | } else if (wake_rgb_count < 13 && wake_rgb_count > 11) { | ||
| 1278 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1279 | rgblight_set_effect_range(0, 6); | ||
| 1280 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1281 | rgblight_set_effect_range(6, 9); | ||
| 1282 | } else if (wake_rgb_count < 14 && wake_rgb_count > 12) { | ||
| 1283 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1284 | rgblight_set_effect_range(0, 5); | ||
| 1285 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1286 | rgblight_set_effect_range(5, 9); | ||
| 1287 | } else if (wake_rgb_count < 15 && wake_rgb_count > 13) { | ||
| 1288 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1289 | rgblight_set_effect_range(0, 4); | ||
| 1290 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1291 | rgblight_set_effect_range(4, 9); | ||
| 1292 | } else if (wake_rgb_count < 16 && wake_rgb_count > 14) { | ||
| 1293 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1294 | rgblight_set_effect_range(0, 3); | ||
| 1295 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1296 | rgblight_set_effect_range(3, 9); | ||
| 1297 | } else if (wake_rgb_count < 17 && wake_rgb_count > 15) { | ||
| 1298 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1299 | rgblight_set_effect_range(0, 2); | ||
| 1300 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1301 | rgblight_set_effect_range(2, 9); | ||
| 1302 | } else if (wake_rgb_count < 18 && wake_rgb_count > 16) { | ||
| 1303 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1304 | rgblight_set_effect_range(0, 1); | ||
| 1305 | rgblight_sethsv_noeeprom(HSV_WHITE); | ||
| 1306 | rgblight_set_effect_range(1, 9); | ||
| 1307 | } else if (wake_rgb_count > 17) { | ||
| 1308 | // Final frame of wake-up rgb animation | ||
| 1309 | rgblight_sethsv_noeeprom(HSV_BLACK); | ||
| 1310 | rgblight_set_effect_range(0, 9); | ||
| 1311 | waking_up = false; | ||
| 1312 | print("I have awoken!\n"); | ||
| 1313 | #ifdef AUDIO_ENABLE | ||
| 1314 | // Play the wake-up sound *after* we finish the animation | ||
| 1315 | if (do_wake_audio) { | ||
| 1316 | PLAY_SONG(puzzle_song); | ||
| 1317 | } | ||
| 1318 | #endif | ||
| 1319 | } | ||
| 1320 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 1321 | wake_rgb_count++; | ||
| 1322 | wake_rgb_timer = timer_read(); | ||
| 1323 | } | ||
| 1324 | } | ||
| 1325 | } | ||
| 1326 | |||
| 1327 | // Spits out some unicode special characters in response to a tap-dance | ||
| 1328 | void send_degree_symbol(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1329 | switch (state->count) { | ||
| 1330 | case 4: | ||
| 1331 | // ℃ | ||
| 1332 | unicode_input_start(); | ||
| 1333 | register_hex(0x2103); | ||
| 1334 | unicode_input_finish(); | ||
| 1335 | print("You pressed the Degrees key 4 times!\n"); | ||
| 1336 | reset_tap_dance(state); | ||
| 1337 | break; | ||
| 1338 | case 3: | ||
| 1339 | //℉ | ||
| 1340 | unicode_input_start(); | ||
| 1341 | register_hex(0x2109); | ||
| 1342 | unicode_input_finish(); | ||
| 1343 | print("You pressed the Degrees key 3 times!\n"); | ||
| 1344 | reset_tap_dance(state); | ||
| 1345 | break; | ||
| 1346 | case 2: | ||
| 1347 | // € | ||
| 1348 | unicode_input_start(); | ||
| 1349 | register_hex(0x20AC); | ||
| 1350 | unicode_input_finish(); | ||
| 1351 | print("You pressed the Degrees key 2 times!\n"); | ||
| 1352 | reset_tap_dance(state); | ||
| 1353 | break; | ||
| 1354 | case 1: | ||
| 1355 | // ° | ||
| 1356 | unicode_input_start(); | ||
| 1357 | register_hex(0x00B0); | ||
| 1358 | unicode_input_finish(); | ||
| 1359 | print("You pressed the Degrees key 1 time!\n"); | ||
| 1360 | reset_tap_dance(state); | ||
| 1361 | break; | ||
| 1362 | } | ||
| 1363 | } | ||
| 1364 | |||
| 1365 | // Handles per-key configuration of Retro-Tapping | ||
| 1366 | bool get_retro_tapping(uint16_t keycode, keyrecord_t* record) { | ||
| 1367 | switch (keycode) { | ||
| 1368 | default: | ||
| 1369 | return false; | ||
| 1370 | } | ||
| 1371 | } | ||
| 1372 | // Handles per-key configuration of Mod-Tap-Interrupt | ||
| 1373 | bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t* record) { | ||
| 1374 | switch (keycode) { | ||
| 1375 | default: | ||
| 1376 | return false; | ||
| 1377 | } | ||
| 1378 | } | ||
| 1379 | // Handles per-key configuration of Tapping Force-Hold | ||
| 1380 | bool get_tapping_force_hold(uint16_t keycode, keyrecord_t* record) { | ||
| 1381 | switch (keycode) { | ||
| 1382 | default: | ||
| 1383 | return false; | ||
| 1384 | } | ||
| 1385 | } | ||
| 1386 | // Handles per-key configuration of Permissive-Hold | ||
| 1387 | bool get_permissive_hold(uint16_t keycode, keyrecord_t* record) { | ||
| 1388 | switch (keycode) { | ||
| 1389 | default: | ||
| 1390 | return false; | ||
| 1391 | } | ||
| 1392 | } | ||
| 1393 | /* | ||
| 1394 | * The following two functions make leader keys "musical" | ||
| 1395 | * by playing sound at different stages of the leader chord | ||
| 1396 | */ | ||
| 1397 | // Called when you tap the Leader key | ||
| 1398 | void leader_start(void) { | ||
| 1399 | #ifdef AUDIO_ENABLE | ||
| 1400 | PLAY_SONG(leader_started); | ||
| 1401 | #endif | ||
| 1402 | } | ||
| 1403 | // Called when either the leader sequence is completed, or the leader timeout is hit | ||
| 1404 | void leader_end(void) { | ||
| 1405 | if (did_leader_succeed) { | ||
| 1406 | #ifdef AUDIO_ENABLE | ||
| 1407 | PLAY_SONG(leader_succeed); | ||
| 1408 | #endif | ||
| 1409 | } else { | ||
| 1410 | #ifdef AUDIO_ENABLE | ||
| 1411 | PLAY_SONG(leader_fail); | ||
| 1412 | #endif | ||
| 1413 | } | ||
| 1414 | } | ||
| 1415 | |||
| 1416 | // Monitors and labels the current state of any tap-dances | ||
| 1417 | td_state_t cur_dance(qk_tap_dance_state_t* state) { | ||
| 1418 | if (state->count == 1) { | ||
| 1419 | if (state->interrupted || !state->pressed) return TD_SINGLE_TAP; | ||
| 1420 | // Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'. | ||
| 1421 | else | ||
| 1422 | return TD_SINGLE_HOLD; | ||
| 1423 | } else if (state->count == 2) { | ||
| 1424 | if (state->interrupted) | ||
| 1425 | return TD_DOUBLE_SINGLE_TAP; | ||
| 1426 | else if (state->pressed) | ||
| 1427 | return TD_DOUBLE_HOLD; | ||
| 1428 | else | ||
| 1429 | return TD_DOUBLE_TAP; | ||
| 1430 | } | ||
| 1431 | if (state->count == 3) { | ||
| 1432 | if (state->interrupted || !state->pressed) | ||
| 1433 | return TD_TRIPLE_TAP; | ||
| 1434 | else | ||
| 1435 | return TD_TRIPLE_HOLD; | ||
| 1436 | } else | ||
| 1437 | return TD_UNKNOWN; | ||
| 1438 | } | ||
| 1439 | |||
| 1440 | // Create an instance of 'td_tap_t' for each tap dance. | ||
| 1441 | static td_tap_t sml_state = {.is_press_action = true, .state = TD_NONE}; | ||
| 1442 | static td_tap_t scap_state = {.is_press_action = true, .state = TD_NONE}; | ||
| 1443 | static td_tap_t slctl_state = {.is_press_action = true, .state = TD_NONE}; | ||
| 1444 | static td_tap_t slalt_state = {.is_press_action = true, .state = TD_NONE}; | ||
| 1445 | |||
| 1446 | // Left-Shift->Sticky-Caps tap-dance finished | ||
| 1447 | void scap_finished(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1448 | scap_state.state = cur_dance(state); | ||
| 1449 | switch (scap_state.state) { | ||
| 1450 | case TD_SINGLE_HOLD: | ||
| 1451 | register_code(KC_LSFT); | ||
| 1452 | break; | ||
| 1453 | default: | ||
| 1454 | if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { | ||
| 1455 | tap_code(KC_CAPS); | ||
| 1456 | reset_tap_dance(state); | ||
| 1457 | break; | ||
| 1458 | } else { | ||
| 1459 | if ((state->count) >= TAPPING_TOGGLE) { | ||
| 1460 | tap_code(KC_CAPS); | ||
| 1461 | reset_tap_dance(state); | ||
| 1462 | break; | ||
| 1463 | } else { | ||
| 1464 | register_code(KC_LSFT); | ||
| 1465 | break; | ||
| 1466 | } | ||
| 1467 | } | ||
| 1468 | } | ||
| 1469 | } | ||
| 1470 | |||
| 1471 | // Left-Shift->Sticky-Caps tap-dance reset | ||
| 1472 | void scap_reset(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1473 | unregister_code(KC_LSHIFT); | ||
| 1474 | scap_state.state = TD_NONE; | ||
| 1475 | } | ||
| 1476 | |||
| 1477 | // Sticky-Left-Control tap-dance finished | ||
| 1478 | void slctl_finished(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1479 | slctl_state.state = cur_dance(state); | ||
| 1480 | switch (slctl_state.state) { | ||
| 1481 | case TD_SINGLE_HOLD: | ||
| 1482 | register_code(KC_LCTL); | ||
| 1483 | break; | ||
| 1484 | default: | ||
| 1485 | if (lctl_sticky) { | ||
| 1486 | unregister_code(KC_LCTL); | ||
| 1487 | lctl_sticky = false; | ||
| 1488 | PLAY_SONG(slctl_off); | ||
| 1489 | reset_tap_dance(state); | ||
| 1490 | break; | ||
| 1491 | } else { | ||
| 1492 | if ((state->count) >= TAPPING_TOGGLE) { | ||
| 1493 | register_code(KC_LCTL); | ||
| 1494 | lctl_sticky = true; | ||
| 1495 | PLAY_SONG(slctl_on); | ||
| 1496 | reset_tap_dance(state); | ||
| 1497 | break; | ||
| 1498 | } else { | ||
| 1499 | register_code(KC_LCTL); | ||
| 1500 | reset_tap_dance(state); | ||
| 1501 | break; | ||
| 1502 | } | ||
| 1503 | } | ||
| 1504 | } | ||
| 1505 | } | ||
| 1506 | |||
| 1507 | // Sticky-Left-Control tap-dance reset | ||
| 1508 | void slctl_reset(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1509 | if (!lctl_sticky) { | ||
| 1510 | unregister_code(KC_LCTL); | ||
| 1511 | slctl_state.state = TD_NONE; | ||
| 1512 | } else { | ||
| 1513 | slctl_state.state = TD_NONE; | ||
| 1514 | } | ||
| 1515 | } | ||
| 1516 | |||
| 1517 | // Sticky-Left-Alt tap-dance finished | ||
| 1518 | void slalt_finished(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1519 | slalt_state.state = cur_dance(state); | ||
| 1520 | switch (slalt_state.state) { | ||
| 1521 | case TD_SINGLE_HOLD: | ||
| 1522 | register_code(KC_LALT); | ||
| 1523 | break; | ||
| 1524 | default: | ||
| 1525 | if (lalt_sticky) { | ||
| 1526 | unregister_code(KC_LALT); | ||
| 1527 | lalt_sticky = false; | ||
| 1528 | PLAY_SONG(slalt_off); | ||
| 1529 | reset_tap_dance(state); | ||
| 1530 | break; | ||
| 1531 | } else { | ||
| 1532 | if ((state->count) >= TAPPING_TOGGLE) { | ||
| 1533 | register_code(KC_LALT); | ||
| 1534 | lalt_sticky = true; | ||
| 1535 | PLAY_SONG(slalt_on); | ||
| 1536 | reset_tap_dance(state); | ||
| 1537 | break; | ||
| 1538 | } else { | ||
| 1539 | register_code(KC_LALT); | ||
| 1540 | reset_tap_dance(state); | ||
| 1541 | break; | ||
| 1542 | } | ||
| 1543 | } | ||
| 1544 | } | ||
| 1545 | } | ||
| 1546 | |||
| 1547 | // Sticky-Left-Alt tap-dance reset | ||
| 1548 | void slalt_reset(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1549 | if (!lalt_sticky) { | ||
| 1550 | unregister_code(KC_LALT); | ||
| 1551 | slalt_state.state = TD_NONE; | ||
| 1552 | } else { | ||
| 1553 | slalt_state.state = TD_NONE; | ||
| 1554 | } | ||
| 1555 | } | ||
| 1556 | |||
| 1557 | // Smiley key tap-dance finished | ||
| 1558 | void sml_finished(qk_tap_dance_state_t* state, void* user_data) { | ||
| 1559 | sml_state.state = cur_dance(state); | ||
| 1560 | switch (sml_state.state) { | ||
| 1561 | default: | ||
| 1562 | switch (state->count) { | ||
| 1563 | default: | ||
| 1564 | // 👍 | ||
| 1565 | send_unicode_string("👍"); | ||
| 1566 | print("You pressed the Emoji key at least 11 times!\n"); | ||
| 1567 | reset_tap_dance(state); | ||
| 1568 | break; | ||
| 1569 | case 10: | ||
| 1570 | // 👎 | ||
| 1571 | send_unicode_string("👎"); | ||
| 1572 | print("You pressed the Emoji key 10 times!\n"); | ||
| 1573 | reset_tap_dance(state); | ||
| 1574 | break; | ||
| 1575 | case 9: | ||
| 1576 | //🍌 | ||
| 1577 | send_unicode_string("🍌"); | ||
| 1578 | print("You pressed the Emoji key 9 times!\n"); | ||
| 1579 | reset_tap_dance(state); | ||
| 1580 | break; | ||
| 1581 | case 8: | ||
| 1582 | // 🍑 | ||
| 1583 | send_unicode_string("🍑"); | ||
| 1584 | print("You pressed the Emoji key 8 times!\n"); | ||
| 1585 | reset_tap_dance(state); | ||
| 1586 | break; | ||
| 1587 | case 7: | ||
| 1588 | // 🐕 | ||
| 1589 | send_unicode_string("🐕"); | ||
| 1590 | print("You pressed the Emoji key 7 times!\n"); | ||
| 1591 | reset_tap_dance(state); | ||
| 1592 | break; | ||
| 1593 | case 6: | ||
| 1594 | // 🐈 | ||
| 1595 | send_unicode_string("🐈"); | ||
| 1596 | print("You pressed the Emoji key 6 times!\n"); | ||
| 1597 | reset_tap_dance(state); | ||
| 1598 | break; | ||
| 1599 | case 5: | ||
| 1600 | // 🐍 | ||
| 1601 | send_unicode_string("🐍"); | ||
| 1602 | print("You pressed the Emoji key 5 times!\n"); | ||
| 1603 | reset_tap_dance(state); | ||
| 1604 | break; | ||
| 1605 | case 4: | ||
| 1606 | //🐒 | ||
| 1607 | send_unicode_string("🐒"); | ||
| 1608 | print("You pressed the Emoji key 4 times!\n"); | ||
| 1609 | reset_tap_dance(state); | ||
| 1610 | break; | ||
| 1611 | case 3: | ||
| 1612 | // 💩 | ||
| 1613 | send_unicode_string("💩"); | ||
| 1614 | print("You pressed the Emoji key 3 times!\n"); | ||
| 1615 | reset_tap_dance(state); | ||
| 1616 | break; | ||
| 1617 | case 2: | ||
| 1618 | // 🙁 | ||
| 1619 | send_unicode_string("🙁"); | ||
| 1620 | print("You pressed the Emoji key 2 times!\n"); | ||
| 1621 | reset_tap_dance(state); | ||
| 1622 | break; | ||
| 1623 | case 1: | ||
| 1624 | // 🙂 | ||
| 1625 | send_unicode_string("🙂"); | ||
| 1626 | print("You pressed the Emoji key 1 time!\n"); | ||
| 1627 | reset_tap_dance(state); | ||
| 1628 | break; | ||
| 1629 | } | ||
| 1630 | break; | ||
| 1631 | case TD_SINGLE_HOLD: | ||
| 1632 | // 👍 | ||
| 1633 | send_unicode_string("👍"); | ||
| 1634 | print("You single-held the Emoji key!\n"); | ||
| 1635 | reset_tap_dance(state); | ||
| 1636 | break; | ||
| 1637 | case TD_DOUBLE_HOLD: | ||
| 1638 | // 👎 | ||
| 1639 | send_unicode_string("👎"); | ||
| 1640 | print("You double-held the Emoji key!\n"); | ||
| 1641 | reset_tap_dance(state); | ||
| 1642 | break; | ||
| 1643 | case TD_TRIPLE_HOLD: | ||
| 1644 | //🤯 | ||
| 1645 | send_unicode_string("🤯"); | ||
| 1646 | print("You triple-held the Emoji key!\n"); | ||
| 1647 | reset_tap_dance(state); | ||
| 1648 | break; | ||
| 1649 | case TD_NONE: | ||
| 1650 | reset_tap_dance(state); | ||
| 1651 | break; | ||
| 1652 | } | ||
| 1653 | } | ||
| 1654 | void sml_reset(qk_tap_dance_state_t* state, void* user_data) { sml_state.state = TD_NONE; } | ||
| 1655 | |||
| 1656 | // Tap Dance definitions | ||
| 1657 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 1658 | // Tap once for °, twice for ℉, thrice for ℃ | ||
| 1659 | [TD_DEG_DEGF] = ACTION_TAP_DANCE_FN(send_degree_symbol), // | ||
| 1660 | [TD_LSHFT_CAPS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, scap_finished, scap_reset, 200), // | ||
| 1661 | [TD_LCTL_STICKY] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, slctl_finished, slctl_reset, 200), // | ||
| 1662 | [TD_LALT_STICKY] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, slalt_finished, slalt_reset, 200), // | ||
| 1663 | [TD_SMILEY] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, sml_finished, sml_reset, 500), | ||
| 1664 | }; | ||
| 1665 | |||
| 1666 | // Dip-Switch controls | ||
| 1667 | void dip_switch_update_user(uint8_t index, bool active) { | ||
| 1668 | switch (index) { | ||
| 1669 | case 0: { | ||
| 1670 | #ifdef AUDIO_ENABLE | ||
| 1671 | static bool play_sound = false; | ||
| 1672 | #endif | ||
| 1673 | if (active) { | ||
| 1674 | #ifdef AUDIO_ENABLE | ||
| 1675 | if (play_sound) { | ||
| 1676 | PLAY_SONG(plover_song); | ||
| 1677 | } | ||
| 1678 | #endif | ||
| 1679 | layer_on(_ADJUST); | ||
| 1680 | } else { | ||
| 1681 | #ifdef AUDIO_ENABLE | ||
| 1682 | if (play_sound) { | ||
| 1683 | PLAY_SONG(plover_gb_song); | ||
| 1684 | } | ||
| 1685 | #endif | ||
| 1686 | layer_off(_ADJUST); | ||
| 1687 | } | ||
| 1688 | #ifdef AUDIO_ENABLE | ||
| 1689 | play_sound = true; | ||
| 1690 | #endif | ||
| 1691 | break; | ||
| 1692 | } | ||
| 1693 | case 1: | ||
| 1694 | if (active) { | ||
| 1695 | muse_mode = true; | ||
| 1696 | } else { | ||
| 1697 | muse_mode = false; | ||
| 1698 | } | ||
| 1699 | } | ||
| 1700 | } | ||
| 1701 | |||
| 1702 | // Runs at every complete matrix scan | ||
| 1703 | void matrix_scan_user(void) { | ||
| 1704 | // Some code for controlling MIDI output | ||
| 1705 | #ifdef AUDIO_ENABLE | ||
| 1706 | if (muse_mode) { | ||
| 1707 | if (muse_counter == 0) { | ||
| 1708 | uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; | ||
| 1709 | if (muse_note != last_muse_note) { | ||
| 1710 | stop_note(compute_freq_for_midi_note(last_muse_note)); | ||
| 1711 | play_note(compute_freq_for_midi_note(muse_note), 0xF); | ||
| 1712 | last_muse_note = muse_note; | ||
| 1713 | } | ||
| 1714 | } | ||
| 1715 | muse_counter = (muse_counter + 1) % muse_tempo; | ||
| 1716 | } else { | ||
| 1717 | if (muse_counter) { | ||
| 1718 | stop_all_notes(); | ||
| 1719 | muse_counter = 0; | ||
| 1720 | } | ||
| 1721 | } | ||
| 1722 | #endif | ||
| 1723 | // Check the shift-state and hold-time for the Irony key | ||
| 1724 | if (irony_active) { | ||
| 1725 | if ((get_mods() & MOD_MASK_SHIFT)) { | ||
| 1726 | irony_shifted = true; | ||
| 1727 | } else { | ||
| 1728 | irony_shifted = false; | ||
| 1729 | } | ||
| 1730 | if (timer_elapsed(irony_pressed_time) >= IRONY_HOLD_DELAY) { | ||
| 1731 | if (irony_shifted) { | ||
| 1732 | send_unicode_string(bang_str); | ||
| 1733 | } else { | ||
| 1734 | send_unicode_string(irony_str); | ||
| 1735 | } | ||
| 1736 | } | ||
| 1737 | } | ||
| 1738 | |||
| 1739 | // Monitor and respond to the current Alt+Tab state | ||
| 1740 | if (is_alt_tab_active) { | ||
| 1741 | if (timer_elapsed(alt_tab_timer) > 1000) { | ||
| 1742 | unregister_code(KC_LALT); | ||
| 1743 | is_alt_tab_active = false; | ||
| 1744 | } | ||
| 1745 | } | ||
| 1746 | // Monitor and perform leader-key chords | ||
| 1747 | LEADER_DICTIONARY() { | ||
| 1748 | did_leader_succeed = leading = false; | ||
| 1749 | |||
| 1750 | SEQ_ONE_KEY(KC_E) { | ||
| 1751 | SEND_STRING(SS_LCTL(SS_LSFT("t"))); | ||
| 1752 | did_leader_succeed = true; | ||
| 1753 | } | ||
| 1754 | SEQ_ONE_KEY(KC_C) { | ||
| 1755 | SEND_STRING(SS_LGUI("r") SS_DELAY(250) "calc\n"); | ||
| 1756 | did_leader_succeed = true; | ||
| 1757 | } | ||
| 1758 | else SEQ_ONE_KEY(KC_V) { | ||
| 1759 | SEND_STRING(SS_LCTL("v")); | ||
| 1760 | did_leader_succeed = true; | ||
| 1761 | } | ||
| 1762 | else SEQ_TWO_KEYS(KC_E, KC_D) { | ||
| 1763 | SEND_STRING(SS_LGUI("r") "cmd\n" SS_LCTL("c")); | ||
| 1764 | did_leader_succeed = true; | ||
| 1765 | } | ||
| 1766 | else SEQ_TWO_KEYS(KC_A, KC_C) { | ||
| 1767 | SEND_STRING(SS_LCTL("a") SS_LCTL("c")); | ||
| 1768 | did_leader_succeed = true; | ||
| 1769 | } | ||
| 1770 | else SEQ_THREE_KEYS(KC_C, KC_A, KC_T) { | ||
| 1771 | send_unicode_string("😸"); | ||
| 1772 | did_leader_succeed = true; | ||
| 1773 | } | ||
| 1774 | else SEQ_THREE_KEYS(KC_B, KC_A, KC_T) { | ||
| 1775 | send_unicode_string("🦇"); | ||
| 1776 | did_leader_succeed = true; | ||
| 1777 | } | ||
| 1778 | else SEQ_THREE_KEYS(KC_D, KC_O, KC_G) { | ||
| 1779 | send_unicode_string("🐶"); | ||
| 1780 | did_leader_succeed = true; | ||
| 1781 | } | ||
| 1782 | else SEQ_FIVE_KEYS(KC_S, KC_M, KC_I, KC_L, KC_E) { | ||
| 1783 | send_unicode_string("🙂"); | ||
| 1784 | did_leader_succeed = true; | ||
| 1785 | } | ||
| 1786 | else SEQ_FOUR_KEYS(KC_H, KC_A, KC_P, KC_Y) { | ||
| 1787 | send_unicode_string("🙂"); | ||
| 1788 | did_leader_succeed = true; | ||
| 1789 | } | ||
| 1790 | else SEQ_FIVE_KEYS(KC_H, KC_A, KC_P, KC_P, KC_Y) { | ||
| 1791 | send_unicode_string("🙂"); | ||
| 1792 | did_leader_succeed = true; | ||
| 1793 | } | ||
| 1794 | else SEQ_THREE_KEYS(KC_S, KC_A, KC_D) { | ||
| 1795 | send_unicode_string("🙁"); | ||
| 1796 | did_leader_succeed = true; | ||
| 1797 | } | ||
| 1798 | else SEQ_THREE_KEYS(KC_Y, KC_E, KC_S) { | ||
| 1799 | send_unicode_string("👍"); | ||
| 1800 | did_leader_succeed = true; | ||
| 1801 | } | ||
| 1802 | else SEQ_TWO_KEYS(KC_N, KC_O) { | ||
| 1803 | send_unicode_string("👎"); | ||
| 1804 | did_leader_succeed = true; | ||
| 1805 | } | ||
| 1806 | else SEQ_THREE_KEYS(KC_W, KC_O, KC_W) { | ||
| 1807 | send_unicode_string("🤯"); | ||
| 1808 | did_leader_succeed = true; | ||
| 1809 | } | ||
| 1810 | else SEQ_THREE_KEYS(KC_P, KC_O, KC_O) { | ||
| 1811 | send_unicode_string("💩"); | ||
| 1812 | did_leader_succeed = true; | ||
| 1813 | } | ||
| 1814 | else SEQ_FOUR_KEYS(KC_P, KC_O, KC_O, KC_P) { | ||
| 1815 | send_unicode_string("💩"); | ||
| 1816 | did_leader_succeed = true; | ||
| 1817 | } | ||
| 1818 | else SEQ_FOUR_KEYS(KC_B, KC_O, KC_A, KC_T) { | ||
| 1819 | send_unicode_string("⛵"); | ||
| 1820 | did_leader_succeed = true; | ||
| 1821 | } | ||
| 1822 | leader_end(); | ||
| 1823 | } | ||
| 1824 | // Run the wake-up RGB animation if performing wake-up | ||
| 1825 | if (do_wake_animation) { | ||
| 1826 | rgb_wakeup_sequence(); | ||
| 1827 | } | ||
| 1828 | } | ||
| 1829 | |||
| 1830 | // Music mask controls | ||
| 1831 | |||
| 1832 | bool music_mask_user(uint16_t keycode) { | ||
| 1833 | switch (keycode) { | ||
| 1834 | case RAISE: | ||
| 1835 | case LOWER: | ||
| 1836 | return false; | ||
| 1837 | default: | ||
| 1838 | return true; | ||
| 1839 | } | ||
| 1840 | } | ||
| 1841 | |||
| 1842 | void suspend_power_down_user(void) { | ||
| 1843 | // Runs during start of system suspend | ||
| 1844 | print("Going to sleep."); | ||
| 1845 | } | ||
| 1846 | |||
| 1847 | void suspend_wakeup_init_user(void) { | ||
| 1848 | // Runs during wake from system suspend | ||
| 1849 | } | ||
| 1850 | |||
| 1851 | void keyboard_post_init_user(void) { | ||
| 1852 | // Print welcome message to console | ||
| 1853 | printf("Welcome to %s!\n", KEEB_MODEL_NAME); | ||
| 1854 | // Read the user config from EEPROM | ||
| 1855 | user_config.raw = eeconfig_read_user(); | ||
| 1856 | do_wake_animation = user_config.do_wakeup_animation; | ||
| 1857 | do_wake_audio = user_config.do_wakeup_audio; | ||
| 1858 | rgbcon_tracker = user_config.rgbcon_tracker; | ||
| 1859 | |||
| 1860 | // Tell the console the status of saved config | ||
| 1861 | if (user_config.do_wakeup_animation) { | ||
| 1862 | print("Wake animation enabled.\n"); | ||
| 1863 | } else { | ||
| 1864 | print("Wake animation disabled.\n"); | ||
| 1865 | } | ||
| 1866 | if (user_config.do_wakeup_audio) { | ||
| 1867 | print("Wake music enabled.\n"); | ||
| 1868 | } else { | ||
| 1869 | print("Wake music disabled.\n"); | ||
| 1870 | } | ||
| 1871 | switch (user_config.rgbcon_tracker) { | ||
| 1872 | case 2: | ||
| 1873 | print("RGB mode: Static White\n"); | ||
| 1874 | break; | ||
| 1875 | case 3: | ||
| 1876 | print("RGB mode: Static Cyan\n"); | ||
| 1877 | break; | ||
| 1878 | case 4: | ||
| 1879 | print("RGB mode: Breathing Lights\n"); | ||
| 1880 | break; | ||
| 1881 | case 5: | ||
| 1882 | print("RGB mode: Rainbow Swirl\n"); | ||
| 1883 | break; | ||
| 1884 | case 6: | ||
| 1885 | print("RGB mode: Rainbow Mood\n"); | ||
| 1886 | break; | ||
| 1887 | default: | ||
| 1888 | print("RGB mode: Disabled RGB\n"); | ||
| 1889 | break; | ||
| 1890 | } | ||
| 1891 | |||
| 1892 | // Enable the LED layers | ||
| 1893 | rgblight_enable_noeeprom(); // Enables RGB, without saving settings | ||
| 1894 | rgblight_layers = my_rgb_layers; | ||
| 1895 | |||
| 1896 | /* | ||
| 1897 | * Initialize the LED crawl wake animation here | ||
| 1898 | * To perform it on just the first wake | ||
| 1899 | */ | ||
| 1900 | wake_rgb_timer = timer_read(); | ||
| 1901 | waking_up = true; | ||
| 1902 | |||
| 1903 | // Initialize OLED display | ||
| 1904 | /* | ||
| 1905 | if (USING_OLED_DISPLAY) { | ||
| 1906 | print("Initializing display!\n"); | ||
| 1907 | render_logo(); | ||
| 1908 | } | ||
| 1909 | */ | ||
| 1910 | } | ||
| 1911 | |||
| 1912 | // EEPROM is getting reset! | ||
| 1913 | void eeconfig_init_user(void) { | ||
| 1914 | user_config.raw = 0; | ||
| 1915 | eeconfig_update_user(user_config.raw); // Write default value to EEPROM now | ||
| 1916 | } | ||
| 1917 | |||
| 1918 | // Communicate 2-way with host via HID_RAW | ||
| 1919 | #ifdef RAW_ENABLE | ||
| 1920 | void raw_hid_receive(uint8_t* data, uint8_t length) { | ||
| 1921 | // Sample code below simply echoes back to the console any data received by the raw_hid process | ||
| 1922 | |||
| 1923 | # ifdef CONSOLE_ENABLE | ||
| 1924 | dprint("Received USB data from host system:\n"); | ||
| 1925 | dprintf("%s\n", data); | ||
| 1926 | # endif | ||
| 1927 | } | ||
| 1928 | #endif | ||
diff --git a/keyboards/planck/keymaps/rootiest/readme.md b/keyboards/planck/keymaps/rootiest/readme.md new file mode 100644 index 000000000..7932ce3fe --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/readme.md | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | |||
| 2 |  | ||
| 3 | |||
| 4 | # The Rootiest Planck Layout | ||
| 5 | |||
| 6 | This layout takes advantage of as many QMK features as possible for a huge complicated beast of a keyboard! | ||
| 7 | |||
| 8 | ## Features include | ||
| 9 | |||
| 10 | - Encoder functions further extended by layers and modifiers | ||
| 11 | - Extensive use of the on-board speaker | ||
| 12 | - Extensive use of the backlight LEDs for startup animations, layer indicators, and bootloader/debug warnings, etc | ||
| 13 | - Many layers, both toggled and momentary. | ||
| 14 | - A toggled Numpad layer, with an emphasis on coding/accounting and with arrow keys on WASD | ||
| 15 | - A "Tabular" layer accessed by holding Tab with frequently used functions, including Alt+Tab via pressing Space | ||
| 16 | - A toggled Mouse-keys layer that allows full control of the mouse movement and buttons from the keyboard | ||
| 17 | - Use of Space-Cadet Shift/Ctrl keys on various layers | ||
| 18 | - Hold enter for Right-Shift | ||
| 19 | - Shift+BackSpace for Delete | ||
| 20 | - Grave-Esc in the top-left Esc key position | ||
| 21 | - Music, Terminal, MIDI, and RGB control on Functions layer | ||
| 22 | - QWERTY, COLEMAK, DVORAK, and PLOVER layers | ||
| 23 | - Special keys for common Ctrl+ combos like Ctrl+C, Ctrl+V, etc | ||
| 24 | - Special keys for Copy-Line, Cut-Line, Delete-Line, etc | ||
| 25 | - Special keys for Ctrl+Alt+Del, Alt+F4, etc | ||
| 26 | - Settings like rgb animation state and startup animation/sound are stored in the EEPROM to survive restart | ||
| 27 | - "Sticky keys" with audible indication allow most modifiers to be locked by pressing multiple times in quick succession | ||
| 28 | - Sticky-locking the Shift key toggles CapsLock instead of locking Shift | ||
| 29 | - Unicode characters and emoji can be sent via custom tap-dance keys | ||
| 30 | - Emoji and app-specific functions can be sent via leader-key chording | ||
| 31 | - VelociKey and word-per-minute tracking are also included | ||
| 32 | |||
| 33 | See the layout here: [Keyboard Layout](http://www.keyboard-layout-editor.com/#/gists/e48e19bc251a8d07ff8475fc1a16f43b) | ||
| 34 | |||
| 35 | To build and flash this keymap, use this command: | ||
| 36 | |||
| 37 | qmk flash -kb planck/rev6 -km rootiest | ||
diff --git a/keyboards/planck/keymaps/rootiest/rules.mk b/keyboards/planck/keymaps/rootiest/rules.mk new file mode 100644 index 000000000..4b93f7db5 --- /dev/null +++ b/keyboards/planck/keymaps/rootiest/rules.mk | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | SRC += muse.c | ||
| 2 | ENCODER_ENABLE = yes # Enables basic encoder support | ||
| 3 | OLED_DRIVER_ENABLE = yes # Enables support for OLED displays | ||
| 4 | # UNICODE_ENABLE = yes # Allow inputting basic unicode characters | ||
| 5 | UNICODEMAP_ENABLE = yes # Enable use of Unicode mapping array | ||
| 6 | # UCIS_ENABLE = yes # Another method for generating Unicode characters via maps | ||
| 7 | TAP_DANCE_ENABLE = yes # Enable Tap-Dance | ||
| 8 | NKRO_ENABLE = yes # Enable N-Key rollover | ||
| 9 | MOUSEKEY_ENABLE = yes # Enable mouse emulation | ||
| 10 | EXTRAKEY_ENABLE = yes # Allows audio control and System control | ||
| 11 | RAW_ENABLE = yes # Enable bi-directional communication to host | ||
| 12 | CONSOLE_ENABLE = yes # Enable outputting debugging data/logs to terminal | ||
| 13 | WPM_ENABLE = yes # Enable on-board words-per-minute tracking | ||
| 14 | VELOCIKEY_ENABLE = yes # Enables dynamically changing rgb animation speed based on WPM | ||
| 15 | LEADER_ENABLE = yes # Enables Leader-Key | ||
| 16 | COMBO_ENABLE = yes # Enables combo keys | ||
| 17 | KEY_LOCK_ENABLE = yes # Enables using lock key to maintain holds | ||
| 18 | # LTO_ENABLE = yes # Does some optimisation to make firmware size smaller | ||
| 19 | # SWAP_HANDS_ENABLE = yes # Enables the swap hands function | ||
| 20 | # DEBOUNCE_TYPE = sym_eager_pk # Change debounce algorithm | ||
| 21 | |||
| 22 | # NOTE: The following requires a lot of memory to include | ||
| 23 | TERMINAL_ENABLE = yes # Enables a command-line-like interface designed to communicate through a text editor with keystrokes | ||
| 24 | |||
| 25 | # NOTE: The following is not yet available in main qmk branch | ||
| 26 | KEY_OVERRIDE_ENABLE = yes # Allows overiding modifier combos (change Shift+1 without affecting 1 or Shift's normal operation) | ||
diff --git a/keyboards/undead60m/config.h b/keyboards/undead60m/config.h new file mode 100644 index 000000000..a307b5db6 --- /dev/null +++ b/keyboards/undead60m/config.h | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2021 Franciso Escobar | ||
| 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 | #include "config_common.h" | ||
| 20 | |||
| 21 | /* USB Device descriptor parameter */ | ||
| 22 | #define VENDOR_ID 0x4D4B // MechanicKeys | ||
| 23 | #define PRODUCT_ID 0x3C4D | ||
| 24 | #define DEVICE_VER 0x0001 | ||
| 25 | #define MANUFACTURER MechanicKeys | ||
| 26 | #define PRODUCT Undead 60-M | ||
| 27 | |||
| 28 | /* key matrix size */ | ||
| 29 | #define MATRIX_ROWS 5 | ||
| 30 | #define MATRIX_COLS 16 | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Keyboard Matrix Assignments | ||
| 34 | * | ||
| 35 | * Change this to how you wired your keyboard | ||
| 36 | * COLS: AVR pins used for columns, left to right | ||
| 37 | * ROWS: AVR pins used for rows, top to bottom | ||
| 38 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
| 39 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
| 40 | * | ||
| 41 | */ | ||
| 42 | #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } | ||
| 43 | #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B7, B5, B4, D7, D6, B3, B2 } | ||
| 44 | #define UNUSED_PINS | ||
| 45 | |||
| 46 | /* COL2ROW or ROW2COL */ | ||
| 47 | #define DIODE_DIRECTION COL2ROW | ||
| 48 | |||
| 49 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 50 | #define DEBOUNCE 5 | ||
| 51 | |||
| 52 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
| 53 | //#define MATRIX_HAS_GHOST | ||
| 54 | |||
| 55 | /* RGB Underglow */ | ||
| 56 | #define RGB_DI_PIN F7 | ||
| 57 | #ifdef RGB_DI_PIN | ||
| 58 | #define RGBLED_NUM 16 | ||
| 59 | #define RGBLIGHT_SLEEP | ||
| 60 | #define RGBLIGHT_EFFECT_BREATHING | ||
| 61 | #define RGBLIGHT_EFFECT_RAINBOW_MOOD | ||
| 62 | #define RGBLIGHT_EFFECT_RAINBOW_SWIRL | ||
| 63 | #define RGBLIGHT_EFFECT_SNAKE | ||
| 64 | #define RGBLIGHT_EFFECT_KNIGHT | ||
| 65 | #define RGBLIGHT_EFFECT_CHRISTMAS | ||
| 66 | #define RGBLIGHT_EFFECT_STATIC_GRADIENT | ||
| 67 | #define RGBLIGHT_EFFECT_RGB_TEST | ||
| 68 | #define RGBLIGHT_EFFECT_ALTERNATING | ||
| 69 | #define RGBLIGHT_EFFECT_TWINKLE | ||
| 70 | #endif | ||
| 71 | |||
| 72 | /* Rotary encoder */ | ||
| 73 | #define ENCODERS_PAD_A { F6 } | ||
| 74 | #define ENCODERS_PAD_B { F5 } | ||
| 75 | #define ENCODER_RESOLUTION 4 | ||
diff --git a/keyboards/undead60m/info.json b/keyboards/undead60m/info.json new file mode 100644 index 000000000..8581f9aa1 --- /dev/null +++ b/keyboards/undead60m/info.json | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "Undead-60M", | ||
| 3 | "url": "", | ||
| 4 | "maintainer": "qmk", | ||
| 5 | "width": 16, | ||
| 6 | "height": 5, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT": { | ||
| 9 | "layout": [ | ||
| 10 | {"label": "F1", "x": 0, "y": 0}, {"label": "F2", "x": 1, "y": 0}, {"label": "Esc", "x": 3.5, "y": 0}, {"label": "1", "x": 4.5, "y": 0}, {"label": "2", "x": 5.5, "y": 0}, {"label": "3", "x": 6.5, "y": 0}, {"label": "4", "x": 7.5, "y": 0}, {"label": "5", "x": 8.5, "y": 0}, {"label": "6", "x": 9.5, "y": 0}, {"label": "7", "x": 10.5, "y": 0}, {"label": "8", "x": 11.5, "y": 0}, {"label": "9", "x": 12.5, "y": 0}, {"label": "0", "x": 13.5, "y": 0}, {"label": "-", "x": 14.5, "y": 0}, {"label": "=", "x": 15.5, "y": 0}, {"label": "Backspace", "x": 16.5, "y": 0}, | ||
| 11 | {"label": "F2", "x": 0, "y": 1}, {"label": "F3", "x": 1, "y": 1}, {"label": "Tab", "x": 3.5, "y": 1}, {"label": "Q", "x": 5, "y": 1}, {"label": "W", "x": 6, "y": 1}, {"label": "E", "x": 7, "y": 1}, {"label": "R", "x": 8, "y": 1}, {"label": "T", "x": 9, "y": 1}, {"label": "Y", "x": 10, "y": 1}, {"label": "U", "x": 11, "y": 1}, {"label": "I", "x": 12, "y": 1}, {"label": "O", "x": 13, "y": 1}, {"label": "P", "x": 14, "y": 1}, {"label": "[", "x": 15, "y": 1}, {"label": "]", "x": 16, "y": 1}, {"label": "|", "x": 17, "y": 1}, | ||
| 12 | {"label": "F4", "x": 0, "y": 2}, {"label": "F5", "x": 1, "y": 2}, {"label": "Caps", "x": 3.5, "y": 2}, {"label": "A", "x": 5.25, "y": 2}, {"label": "S", "x": 6.25, "y": 2}, {"label": "D", "x": 7.25, "y": 2}, {"label": "F", "x": 8.25, "y": 2}, {"label": "G", "x": 9.25, "y": 2}, {"label": "H", "x": 10.25, "y": 2}, {"label": "J", "x": 11.25, "y": 2}, {"label": "K", "x": 12.25, "y": 2}, {"label": "L", "x": 13.25, "y": 2}, {"label": ";", "x": 14.25, "y": 2}, {"label": "'", "x": 15.25, "y": 2}, {"label": "Enter", "x": 16.25, "y": 2}, | ||
| 13 | {"label": "F6", "x": 0, "y": 3}, {"label": "F7", "x": 1, "y": 3}, {"label": "Shift", "x": 3.5, "y": 3}, {"label": "Z", "x": 5.5, "y": 3}, {"label": "X", "x": 6.5, "y": 3}, {"label": "C", "x": 7.5, "y": 3}, {"label": "V", "x": 8.5, "y": 3}, {"label": "B", "x": 9.5, "y": 3}, {"label": "N", "x": 10.5, "y": 3}, {"label": "M", "x": 11.5, "y": 3}, {"label": ",", "x": 12.5, "y": 3}, {"label": ".", "x": 13.5, "y": 3}, {"label": "/", "x": 14.5, "y": 3}, {"label": "Shift", "x": 15.5, "y": 3}, | ||
| 14 | {"label": "F1", "x": 0, "y": 4}, {"label": "F2", "x": 1, "y": 4}, {"label": "Ctrl", "x": 3.5, "y": 4}, {"label": "OS", "x": 4.75, "y": 4}, {"label": "Alt", "x": 6, "y": 4}, {"label": "Space", "x": 7.25, "y": 4}, {"label": "Alt", "x": 13.5, "y": 4}, {"label": "OS", "x": 14.75, "y": 4}, {"label": "Ctrl", "x": 16, "y": 4}, {"label": "Fn", "x": 17.25, "y": 4} | ||
| 15 | ] | ||
| 16 | } | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/keyboards/undead60m/keymaps/default/keymap.c b/keyboards/undead60m/keymaps/default/keymap.c new file mode 100644 index 000000000..7760a671e --- /dev/null +++ b/keyboards/undead60m/keymaps/default/keymap.c | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /* Copyright 2021 Francisco Escobar | ||
| 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 | |||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 20 | [0] = LAYOUT( /* 0: qwerty */ | ||
| 21 | KC_MPLY, KC_P1, KC_ESC, 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, | ||
| 22 | KC_P2, KC_P3, 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, | ||
| 23 | KC_P4, KC_P5, 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, | ||
| 24 | KC_P6, KC_P7, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
| 25 | KC_P8, KC_P9, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(1) | ||
| 26 | ), | ||
| 27 | |||
| 28 | [1] = LAYOUT( /* 1: fn */ | ||
| 29 | KC_TRNS, KC_TRNS, 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, KC_TRNS, | ||
| 30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 31 | KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 32 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 33 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_TRNS | ||
| 34 | ), | ||
| 35 | |||
| 36 | [2] = LAYOUT( /* 2: media */ | ||
| 37 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 39 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 40 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 41 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS | ||
| 42 | ), | ||
| 43 | |||
| 44 | [3] = LAYOUT( /*3: RGB */ | ||
| 45 | RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 46 | RGB_HUD, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 47 | RGB_SAD, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 48 | RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 49 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 50 | ), | ||
| 51 | }; | ||
diff --git a/keyboards/undead60m/keymaps/via/keymap.c b/keyboards/undead60m/keymaps/via/keymap.c new file mode 100644 index 000000000..9ab159ab1 --- /dev/null +++ b/keyboards/undead60m/keymaps/via/keymap.c | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* Copyright 2021 Francisco Escobar | ||
| 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 | |||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 20 | [0] = LAYOUT( /* 0: qwerty */ | ||
| 21 | KC_MPLY, KC_P1, KC_ESC, 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, | ||
| 22 | KC_P2, KC_P3, 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, | ||
| 23 | KC_P4, KC_P5, 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, | ||
| 24 | KC_P6, KC_P7, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
| 25 | KC_P8, KC_P9, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(1) | ||
| 26 | ), | ||
| 27 | |||
| 28 | [1] = LAYOUT( /* 1: fn */ | ||
| 29 | KC_TRNS, KC_TRNS, 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, KC_TRNS, | ||
| 30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 31 | KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 32 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 33 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_TRNS | ||
| 34 | ), | ||
| 35 | |||
| 36 | [2] = LAYOUT( /* 2: media */ | ||
| 37 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 39 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 40 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 41 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS | ||
| 42 | ), | ||
| 43 | |||
| 44 | [3] = LAYOUT( /*3: RGB */ | ||
| 45 | RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 46 | RGB_HUD, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 47 | RGB_SAD, RGB_SAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 48 | RGB_VAD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 49 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 50 | ), | ||
| 51 | }; | ||
| 52 | |||
diff --git a/keyboards/undead60m/keymaps/via/rules.mk b/keyboards/undead60m/keymaps/via/rules.mk new file mode 100644 index 000000000..036bd6d1c --- /dev/null +++ b/keyboards/undead60m/keymaps/via/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| VIA_ENABLE = yes \ No newline at end of file | |||
diff --git a/keyboards/undead60m/readme.md b/keyboards/undead60m/readme.md new file mode 100644 index 000000000..6f62d3033 --- /dev/null +++ b/keyboards/undead60m/readme.md | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # Undead 60M | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 |  | ||
| 6 | |||
| 7 |  | ||
| 8 | |||
| 9 | A 60% PCB with some add-ons | ||
| 10 | - RGB Underglow | ||
| 11 | - Macro cluster | ||
| 12 | - Hotswap | ||
| 13 | - optional Knob | ||
| 14 | |||
| 15 | * Keyboard Maintainer: [jfescobar18](https://github.com/jfescobar18) | ||
| 16 | * Hardware Supported: Undead 60M PCB | ||
| 17 | * Hardware Availability: [MechanicKeys](https://www.facebook.com/MechanicKeys-104963764775280) | ||
| 18 | |||
| 19 | Make example for this keyboard (after setting up your build environment): | ||
| 20 | |||
| 21 | make undead60m/:default | ||
| 22 | |||
| 23 | Flashing example for this keyboard: | ||
| 24 | |||
| 25 | make undead60m:default:flash | ||
| 26 | |||
| 27 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
diff --git a/keyboards/undead60m/rules.mk b/keyboards/undead60m/rules.mk new file mode 100644 index 000000000..0cf19a0f6 --- /dev/null +++ b/keyboards/undead60m/rules.mk | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = atmel-dfu | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | # change yes to no to disable | ||
| 9 | # | ||
| 10 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | ||
| 11 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
| 12 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 13 | CONSOLE_ENABLE = no # Console for debug | ||
| 14 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 15 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 17 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 18 | NKRO_ENABLE = no # USB Nkey Rollover | ||
| 19 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 20 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | ||
| 21 | BLUETOOTH_ENABLE = no # Enable Bluetooth | ||
| 22 | AUDIO_ENABLE = no # Audio output | ||
| 23 | KEYBOARD_LOCK_ENABLE = yes | ||
| 24 | ENCODER_ENABLE = yes | ||
| 25 | LTO_ENABLE = yes | ||
diff --git a/keyboards/undead60m/undead60m.c b/keyboards/undead60m/undead60m.c new file mode 100644 index 000000000..5cedd10e8 --- /dev/null +++ b/keyboards/undead60m/undead60m.c | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* Copyright 2021 Francisco Escobar | ||
| 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 "undead60m.h" | ||
| 18 | bool encoder_update_kb(uint8_t index, bool clockwise) { | ||
| 19 | if (!encoder_update_user(index, clockwise)) { return false; } | ||
| 20 | if (index == 0) { | ||
| 21 | switch (get_highest_layer(layer_state)) { | ||
| 22 | case 0: /* Layer 1: Volume */ | ||
| 23 | if (clockwise) { | ||
| 24 | tap_code(KC_VOLD); | ||
| 25 | } else { | ||
| 26 | tap_code(KC_VOLU); | ||
| 27 | } | ||
| 28 | break; | ||
| 29 | case 1: /* Layer 2: Scroll */ | ||
| 30 | if (clockwise) { | ||
| 31 | tap_code(KC_WH_U); | ||
| 32 | } else { | ||
| 33 | tap_code(KC_WH_D); | ||
| 34 | } | ||
| 35 | break; | ||
| 36 | case 2: /* Layer 3: Change Track */ | ||
| 37 | if (clockwise) { | ||
| 38 | tap_code(KC_MPRV); | ||
| 39 | } else { | ||
| 40 | tap_code(KC_MNXT); | ||
| 41 | } | ||
| 42 | break; | ||
| 43 | case 3: /* Layer 4: Brightness */ | ||
| 44 | if (clockwise) { | ||
| 45 | tap_code(KC_BRID); | ||
| 46 | } else { | ||
| 47 | tap_code(KC_BRIU); | ||
| 48 | } | ||
| 49 | break; | ||
| 50 | default: /* Default: Volume */ | ||
| 51 | if (clockwise) { | ||
| 52 | tap_code(KC_VOLU); | ||
| 53 | } else { | ||
| 54 | tap_code(KC_VOLD); | ||
| 55 | } | ||
| 56 | break; | ||
| 57 | } | ||
| 58 | } | ||
| 59 | return true; | ||
| 60 | } | ||
diff --git a/keyboards/undead60m/undead60m.h b/keyboards/undead60m/undead60m.h new file mode 100644 index 000000000..2d71e9640 --- /dev/null +++ b/keyboards/undead60m/undead60m.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* Copyright 2021 Francisco Escobar | ||
| 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 | #include "quantum.h" | ||
| 20 | |||
| 21 | #define LAYOUT( \ | ||
| 22 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ | ||
| 23 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ | ||
| 24 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ | ||
| 25 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ | ||
| 26 | K40, K41, K42, K43, K44, K48, K4C, K4D, K4E, K4F \ | ||
| 27 | ) \ | ||
| 28 | { \ | ||
| 29 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ | ||
| 30 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ | ||
| 31 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, KC_NO }, \ | ||
| 32 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, KC_NO }, \ | ||
| 33 | { K40, K41, K42, K43, K44, KC_NO, KC_NO, KC_NO, K48, KC_NO, KC_NO, KC_NO, K4C, K4D, K4E, K4F } \ | ||
| 34 | } | ||
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index bcb4d81ef..7f9907a50 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py | |||
| @@ -74,7 +74,7 @@ def info_json(keyboard): | |||
| 74 | except jsonschema.ValidationError as e: | 74 | except jsonschema.ValidationError as e: |
| 75 | json_path = '.'.join([str(p) for p in e.absolute_path]) | 75 | json_path = '.'.join([str(p) for p in e.absolute_path]) |
| 76 | cli.log.error('Invalid API data: %s: %s: %s', keyboard, json_path, e.message) | 76 | cli.log.error('Invalid API data: %s: %s: %s', keyboard, json_path, e.message) |
| 77 | exit() | 77 | exit(1) |
| 78 | 78 | ||
| 79 | # Make sure we have at least one layout | 79 | # Make sure we have at least one layout |
| 80 | if not info_data.get('layouts'): | 80 | if not info_data.get('layouts'): |
diff --git a/lib/python/qmk/json_schema.py b/lib/python/qmk/json_schema.py index 3e5663a29..cbc5bff51 100644 --- a/lib/python/qmk/json_schema.py +++ b/lib/python/qmk/json_schema.py | |||
| @@ -17,9 +17,12 @@ def json_load(json_file): | |||
| 17 | try: | 17 | try: |
| 18 | return hjson.load(json_file.open(encoding='utf-8')) | 18 | return hjson.load(json_file.open(encoding='utf-8')) |
| 19 | 19 | ||
| 20 | except json.decoder.JSONDecodeError as e: | 20 | except (json.decoder.JSONDecodeError, hjson.HjsonDecodeError) as e: |
| 21 | cli.log.error('Invalid JSON encountered attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) | 21 | cli.log.error('Invalid JSON encountered attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) |
| 22 | exit(1) | 22 | exit(1) |
| 23 | except Exception as e: | ||
| 24 | cli.log.error('Unknown error attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) | ||
| 25 | exit(1) | ||
| 23 | 26 | ||
| 24 | 27 | ||
| 25 | def load_jsonschema(schema_name): | 28 | def load_jsonschema(schema_name): |
