diff --git a/keyboards/id67/config.h b/keyboards/id67/config.h index 785fa598be4e..579d6b62e945 100644 --- a/keyboards/id67/config.h +++ b/keyboards/id67/config.h @@ -20,12 +20,14 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0x6964 /* "id" */ +#define VENDOR_ID 0x6964 /* "id" */ #define PRODUCT_ID 0x0067 #define DEVICE_VER 0x0001 #define MANUFACTURER IDOBAO #define PRODUCT ID67 +#define ID67_CAPS_LOCK_KEY_INDEX 36 // position of Caps-Lock key for the RGB Matrix + /* key matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 15 @@ -46,32 +48,20 @@ #define DIODE_DIRECTION COL2ROW #define RGB_DI_PIN F0 -// RGB Light config -#if defined(RGBLIGHT_ENABLE) - #define RGBLED_NUM 77 - #define RGBLIGHT_HUE_STEP 8 - #define RGBLIGHT_SAT_STEP 8 - #define RGBLIGHT_VAL_STEP 8 - #define RGBLIGHT_LIMIT_VAL 150 /* The maximum brightness level */ - #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ -/*== all animations enable ==*/ - #define RGBLIGHT_ANIMATIONS -// /*== or choose animations ==*/ -// #define RGBLIGHT_EFFECT_BREATHING -// #define RGBLIGHT_EFFECT_RAINBOW_MOOD -// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL -// #define RGBLIGHT_EFFECT_SNAKE -// #define RGBLIGHT_EFFECT_KNIGHT -// #define RGBLIGHT_EFFECT_CHRISTMAS -// #define RGBLIGHT_EFFECT_STATIC_GRADIENT -// #define RGBLIGHT_EFFECT_RGB_TEST -// #define RGBLIGHT_EFFECT_ALTERNATING -#endif - // RGB Matrix config #if defined(RGB_MATRIX_ENABLE) - #define DRIVER_LED_TOTAL 77 - #define DRIVER_LED_UNDERGLOW 10 + /* + * Use `#define ID67_DISABLE_UNDERGLOW` in your keymap `config.h` if you have + * an ID67 with a solid underplate to disable the under-glow LED's. + * e.g. ID67 with no acrilic, or the ID67 Bestype + */ + #ifndef ID67_DISABLE_UNDERGLOW + #define DRIVER_LED_TOTAL 77 + #define DRIVER_LED_UNDERGLOW 10 + #elif + #define DRIVER_LED_TOTAL 67 + #define DRIVER_LED_UNDERGLOW 0 + #endif #define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 @@ -105,22 +95,22 @@ #define ENABLE_RGB_MATRIX_HUE_BREATHING // Hue shifts up a slight ammount at the same time, then shifts back #define ENABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight ammount in a wave to the right, then back to the left #define ENABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight ammount and then back down in a wave to the right -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - #define ENABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM! - #define ENABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation -#endif -#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE// Pulses keys hit to hue & value then fades value out - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out - #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out - #define ENABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out - #define ENABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out - #define ENABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out - #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out -#endif // #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) + #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + #define ENABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM! + #define ENABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation + #endif // #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE// Pulses keys hit to hue & value then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out + #define ENABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out + #define ENABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out + #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out + #endif // #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) #endif // #if defined(RGB_MATRIX_ENABLE) diff --git a/keyboards/id67/id67.c b/keyboards/id67/id67.c index d0d4718eb766..5f4ff39ae2c8 100644 --- a/keyboards/id67/id67.c +++ b/keyboards/id67/id67.c @@ -29,21 +29,33 @@ led_config_t g_led_config = { { { 8, 7, __, 6, __, __, 5, __, __, __, 4, 3, 2, 1, 0}, }, { // LED Index to Physical Position - {239, 64}, {222, 64}, {207, 64}, {180, 64}, {160, 64}, {107, 64}, {40, 64}, {20, 64}, {0, 64}, - {239, 48}, {222, 48}, {204, 48}, {184, 48}, {168, 48}, {152, 48}, {136, 48}, {120, 48}, {104, 48}, {88, 48}, {72, 48}, {56, 48}, {40, 48}, {13, 48}, - {239, 32}, {210, 32}, {189, 32}, {173, 32}, {157, 32}, {141, 32}, {125, 32}, {109, 32}, {93, 32}, {77, 32}, {61, 32}, {45, 32}, {29, 32}, {8, 32}, - {239, 16}, {220, 16}, {201, 16}, {185, 16}, {169, 16}, {153, 16}, {137, 16}, {121, 16}, {105, 16}, {89, 16}, {73, 16}, {57, 16}, {41, 16}, {25, 16}, {5, 16}, - {239, 0}, {217, 0}, {192, 0}, {176, 0}, {160, 0}, {144, 0}, {128, 0}, {112, 0}, {96, 0}, {80, 0}, {64, 0}, {48, 0}, {32, 0}, {16, 0}, {0, 0}, + // based on: https://gist.github.com/vinorodrigues/07fd735683856b2a06c7c52b9b3878cb + {224, 64}, {209, 64}, {194, 64}, {170, 64}, {151, 64}, {95, 64}, {39, 64}, {21, 64}, {2, 64}, + {224, 48}, {209, 48}, {189, 48}, {168, 48}, {153, 48}, {138, 48}, {123, 48}, {108, 48}, {93, 48}, {78, 48}, {63, 48}, {49, 48}, {34, 48}, {9, 48}, + {224, 32}, {200, 32}, {175, 32}, {161, 32}, {146, 32}, {131, 32}, {116, 32}, {101, 32}, {86, 32}, {71, 32}, {56, 32}, {41, 32}, {26, 32}, {6, 32}, + {224, 16}, {205, 16}, {187, 16}, {172, 16}, {157, 16}, {142, 16}, {127, 16}, {112, 16}, {97, 16}, {82, 16}, {67, 16}, {52, 16}, {37, 16}, {22, 16}, {4, 16}, + {224, 0}, {202, 0}, {179, 0}, {164, 0}, {149, 0}, {134, 0}, {119, 0}, {105, 0}, {90, 0}, {75, 0}, {60, 0}, {45, 0}, {30, 0}, {15, 0}, {0, 0} + #ifndef ID67_DISABLE_UNDERGLOW // underglow LEDs - {0, 0}, {56, 0}, {112, 0}, {168, 0}, {224, 0}, + , {0, 0}, {56, 0}, {112, 0}, {168, 0}, {224, 0}, {224, 64}, {168, 64}, {112, 64}, {56, 64}, {0, 64} + #endif }, { // LED Index to Flag - 4, 4, 4, 1, 1, 4, 1, 1, 1, // first row - 1, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, // second row - 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, // third row - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, // fourth row - 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // fifth row + 4, 4, 4, 1, 1, 4, 1, 1, 1, // first row + 1, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, // second row + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, // third row + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, // fourth row + 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 // fifth row // underglow leds - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + #ifndef ID67_DISABLE_UNDERGLOW + , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + #endif } }; + +__attribute__ ((weak)) +void rgb_matrix_indicators_user(void) { + if (host_keyboard_led_state().caps_lock) { + rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, 0xFF, 0xFF, 0xFF); + } +} diff --git a/keyboards/id67/id67.h b/keyboards/id67/id67.h index cca757bfc7df..a8eead92a035 100644 --- a/keyboards/id67/id67.h +++ b/keyboards/id67/id67.h @@ -19,6 +19,8 @@ #include "quantum.h" +#define ___ KC_NO + #define LAYOUT_65_ansi_blocker( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ @@ -26,9 +28,9 @@ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ K40, K41, K43, K46, K4A, K4B, K4C, K4D, K4E \ ) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, K2E }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ - { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D, K2E }, \ + { K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, ___, K43, ___, ___, K46, ___, ___, ___, K4A, K4B, K4C, K4D, K4E }, \ } diff --git a/keyboards/id67/keymaps/default_nug/config.h b/keyboards/id67/keymaps/default_nug/config.h new file mode 100644 index 000000000000..d92c93ce1e99 --- /dev/null +++ b/keyboards/id67/keymaps/default_nug/config.h @@ -0,0 +1,26 @@ +/* Copyright 2021 thewerther + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * NB! THIS VARIANT DISABLES THE UNDERGLOW LEDs + * FOR BOARDS WITH A SOLID (NON-ACRILIC) BOTTOM + */ + +#pragma once + +#if defined(RGB_MATRIX_ENABLE) + #define ID67_DISABLE_UNDERGLOW +#endif diff --git a/keyboards/id67/keymaps/default_nug/keymap.c b/keyboards/id67/keymaps/default_nug/keymap.c new file mode 100644 index 000000000000..30e71734a39c --- /dev/null +++ b/keyboards/id67/keymaps/default_nug/keymap.c @@ -0,0 +1,41 @@ +/* Copyright 2021 Tybera + * Copyright 2022 thewerther + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * NB! THIS VARIANT DISABLES THE UNDERGLOW LEDs + * FOR BOARDS WITH A SOLID (NON-ACRILIC) BOTTOM + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_65_ansi_blocker( + 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_TILD, + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_65_ansi_blocker( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______, _______, + _______, RESET, RGB_SPI, RGB_SPD, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_DEL, KC_END, KC_PGDN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/id67/keymaps/via_nug/config.h b/keyboards/id67/keymaps/via_nug/config.h new file mode 100644 index 000000000000..a2fa129b2e53 --- /dev/null +++ b/keyboards/id67/keymaps/via_nug/config.h @@ -0,0 +1,27 @@ +/* Copyright 2021 thewerther + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * NB! THIS VARIANT DISABLES THE UNDERGLOW LEDs + * FOR BOARDS WITH A SOLID (NON-ACRILIC) BOTTOM + */ + +#pragma once + +#if defined(RGB_MATRIX_ENABLE) + #define VIA_QMK_RGBLIGHT_ENABLE + #define ID67_DISABLE_UNDERGLOW +#endif diff --git a/keyboards/id67/keymaps/via_nug/keymap.c b/keyboards/id67/keymaps/via_nug/keymap.c new file mode 100644 index 000000000000..b008f9d125ac --- /dev/null +++ b/keyboards/id67/keymaps/via_nug/keymap.c @@ -0,0 +1,53 @@ +/* Copyright 2021 Tybera + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * NB! THIS VARIANT DISABLES THE UNDERGLOW LEDs + * FOR BOARDS WITH A SOLID (NON-ACRILIC) BOTTOM + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_65_ansi_blocker( + 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_TILD, + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT_65_ansi_blocker( + 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, _______, _______, + _______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______, _______, + _______, RESET, BL_DEC, BL_TOGG, BL_INC, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_DEL, KC_END, KC_PGDN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT_65_ansi_blocker( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [3] = LAYOUT_65_ansi_blocker( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/id67/keymaps/via_nug/rules.mk b/keyboards/id67/keymaps/via_nug/rules.mk new file mode 100644 index 000000000000..ca9fed0e6b53 --- /dev/null +++ b/keyboards/id67/keymaps/via_nug/rules.mk @@ -0,0 +1,2 @@ +LTO_ENABLE = yes +VIA_ENABLE = yes diff --git a/keyboards/id67/keymaps/vinorodrigues/config.h b/keyboards/id67/keymaps/vinorodrigues/config.h new file mode 100644 index 000000000000..88fe361bde4d --- /dev/null +++ b/keyboards/id67/keymaps/vinorodrigues/config.h @@ -0,0 +1,85 @@ +/* + * Idobao ID67 Keymap for a ID67 Bestype, built for Mac use + * Copyright (C) 2022 Vino Rodrigues + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#if defined(RGB_MATRIX_ENABLE) + #define VIA_QMK_RGBLIGHT_ENABLE + #define ID67_DISABLE_UNDERGLOW // personal choice, I use a ID67 Bestype + + #ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS + #undef RGB_MATRIX_MAXIMUM_BRIGHTNESS + #endif + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // // limits maximum brightness of LEDs to 200 out of 255 + + //// #define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended + + //// #define RGB_MATRIX_KEYPRESSES + + // RGB Matrix config, nit-pick a few animations. "////" = already defined in base `config.h`, `#undef` disables it + + //// #define ENABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue + //// #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom, speed controls how much gradient changes + //// #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT // Static gradient left to right, speed controls how much gradient changes + //// #define ENABLE_RGB_MATRIX_BREATHING // Single hue brightness cycling animation + //// #define ENABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right + //// #define ENABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right + //// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation + //// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness + //// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades saturation + //// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness + //// #define ENABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient + //// #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient scrolling left to right + //// #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom + //// #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in + //// #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in + //// #define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right + //// #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard + //// #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard + //// #define ENABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard + //// #define ENABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard + //// #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard + //// #define ENABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue + //// #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation + //// #define ENABLE_RGB_MATRIX_HUE_BREATHING // Hue shifts up a slight ammount at the same time, then shifts back + //// #define ENABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight ammount in a wave to the right, then back to the left + //// #define ENABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight ammount and then back down in a wave to the right + + #undef ENABLE_RGB_MATRIX_PIXEL_RAIN + #undef ENABLE_RGB_MATRIX_PIXEL_FLOW + #undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL + + #if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) + //// #define ENABLE_RGB_MATRIX_TYPING_HEATMAP + //// #define ENABLE_RGB_MATRIX_DIGITAL_RAIN + #undef ENABLE_RGB_MATRIX_TYPING_HEATMAP + #endif + + #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out + //// #define ENABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out + //// #define ENABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out + //// #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out + #endif +#endif diff --git a/keyboards/id67/keymaps/vinorodrigues/keymap.c b/keyboards/id67/keymaps/vinorodrigues/keymap.c new file mode 100644 index 000000000000..62fd4cfa8f7e --- /dev/null +++ b/keyboards/id67/keymaps/vinorodrigues/keymap.c @@ -0,0 +1,261 @@ +/* + * Idobao ID67 Keymap for a ID67 Bestype, built for Mac use + * Copyright (C) 2022 Vino Rodrigues + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "version.h" + +enum { + LAYER_0 = 0, + LAYER_1, + LAYER_2, + LAYER_3 +}; + +enum { + KC_MCON = USER00, + KC_LPAD, + KB_VRSN = SAFE_RANGE +}; + +enum macos_consumer_usages { + _AC_SHOW_ALL_WINDOWS = 0x29F, // mapped to KC_MCON + _AC_SHOW_ALL_APPS = 0x2A0 // mapped to KC_LPAD +}; + +#define LT1_C_L LT(LAYER_1, KC_CAPS) + +#ifndef MIN + #define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [LAYER_0] = LAYOUT_65_ansi_blocker( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRAVE, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, KC_DELETE, \ + LT1_C_L, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, FN_MO13, FN_MO23, KC_LEFT, KC_DOWN, KC_RIGHT), + [LAYER_1] = LAYOUT_65_ansi_blocker( + KC_GRAVE, 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_ERAS, KC_F13, \ + _______, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_HOME, KC_END, KC_EJCT, KC_INS, \ + KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, KC_PENT, KC_HOME, \ + KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_DELETE, KC_LSFT, _______, KC_END, \ + KC_RCTL, KC_RALT, KC_RGUI, _______, _______, _______, _______, _______, _______), + [LAYER_2] = LAYOUT_65_ansi_blocker( + KC_ESC, KC_BRID, KC_BRIU, KC_MCON, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_OUT, KC_F14, \ + RGB_TOG, RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, \ + XXXXXXX, RGB_RMOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, RGB_SAI, XXXXXXX, KC_SLCK, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUD, RGB_SAD, XXXXXXX, RGB_VAI, KC_PAUS, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SPD, RGB_VAD, RGB_SPI), + [LAYER_3] = LAYOUT_65_ansi_blocker( + RESET, MACRO01, MACRO02, MACRO03, MACRO04, MACRO05, MACRO06, MACRO07, MACRO08, MACRO09, MACRO10, MACRO11, MACRO12, KC_POWER, KC_F15, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLEP, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KB_VRSN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MACRO00, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, KC_WAKE, XXXXXXX, XXXXXXX, MACRO13, MACRO14, MACRO15), +}; + +#ifdef RGB_MATRIX_ENABLE + +/* + * RGB Stuff + */ + +#ifdef RGBLIGHT_VAL_STEP + #define RGB_BRIGHTER_BY RGBLIGHT_VAL_STEP +#else + #define RGB_BRIGHTER_BY 26 // about 10% +#endif + +#define LED_FLAG_ALPHA_KEY 0x10 // Alpha keys (for Caps Lock) +#define LED_FLAG_LAYER_IND 0x20 // Layer indicator + +const uint8_t g_led_config_new_flags[DRIVER_LED_TOTAL] = { + // Extended LED Index to Flag + // ** Remember: on ID67 this is in reverse order + 0x21, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x21, // Spc row + 0x21, 0x01, 0x01, 0x04, 0x04, 0x04, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x21, // ZXC row + 0x21, 0x01, 0x04, 0x04, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x29, // ASD row + 0x21, 0x04, 0x04, 0x04, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x21, // QWE row + 0x21, 0x01, 0x04, 0x04, 0x04, 0x04, 0x24, 0x24, 0x24, 0x24, 0x04, 0x04, 0x04, 0x04, 0x21 // 123 row +}; + +bool isRGBOff = false; +bool isCapsBlink = false; +static uint16_t recording_timer; + +void keyboard_pre_init_user(void) { + // override `config.h` flags with new values + for (int i = 0; i < DRIVER_LED_TOTAL; i++) g_led_config.flags[i] = g_led_config_new_flags[i]; +} + +void keyboard_post_init_user(void) { + isRGBOff = false; +} + +void rgb_matrix_indicators_user(void) { + // do nothing, override base <> function to disable it +} + +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + + uint8_t v = MIN( rgblight_get_val() + RGB_BRIGHTER_BY, 0xFF ); + uint8_t current_layer = get_highest_layer(layer_state); + + // Caps Lock key stuff + + if (host_keyboard_led_state().caps_lock) { + if (isRGBOff) { + rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, v, v, v); // white + } else { + // Caps Lock key/LED + if (timer_elapsed(recording_timer) > 500) { + isCapsBlink = !isCapsBlink; + recording_timer = timer_read(); + } + if (isCapsBlink) { + rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, v, v, v); // white + } + + // Alpha keys/LEDs + for (uint8_t i = led_min; i <= led_max; i++) { + if ((g_led_config.flags[i] & LED_FLAG_ALPHA_KEY) != 0) { + rgb_matrix_set_color(i, v, 0, 0); //red + } + } + } + } else if (isRGBOff) { + uint8_t r = 0; + uint8_t g = 0; + uint8_t b = 0; + + if ((g_led_config.flags[ID67_CAPS_LOCK_KEY_INDEX] & LED_FLAG_LAYER_IND) != 0) { + switch (current_layer) { + case LAYER_1: b = v; break; // blue + case LAYER_2: g = v; break; // green + case LAYER_3: r = v; break; // red + } + } + + rgb_matrix_set_color(ID67_CAPS_LOCK_KEY_INDEX, r, g, b); // off + } + + // Layer indicator stuff + + switch (current_layer) { + case LAYER_1: + for (uint8_t i = led_min; i <= led_max; i++) { + if ((g_led_config.flags[i] & LED_FLAG_LAYER_IND) != 0) { + rgb_matrix_set_color(i, 0, 0, v); // blue + } + } + break; + + case LAYER_2: + for (uint8_t i = led_min; i <= led_max; i++) { + if ((g_led_config.flags[i] & LED_FLAG_LAYER_IND) != 0) { + rgb_matrix_set_color(i, 0, v, 0); // green + } + } + break; + + case LAYER_3: + for (uint8_t i = led_min; i <= led_max; i++) { + if ((g_led_config.flags[i] & LED_FLAG_LAYER_IND) != 0) { + rgb_matrix_set_color(i, v, 0, 0); // red + } + } + break; + + default: + if (isRGBOff) { + // switch layer indicators off only if in OFF mode + for (uint8_t i = led_min; i <= led_max; i++) { + if ((g_led_config.flags[i] & LED_FLAG_LAYER_IND) != 0) { + rgb_matrix_set_color(i, 0, 0, 0); // red + } + } + } + break; + } +} + +/* + * Sleep mode stuff (untested) + */ + +void suspend_power_down_user(void) { + rgb_matrix_set_suspend_state(true); +} + +void suspend_wakeup_init_user(void) { + rgb_matrix_set_suspend_state(false); +} + +#endif + +/* + * Mac Fn-key stuff + */ + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + // handle RGB toggle key + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: + isRGBOff = true; + rgb_matrix_set_flags(LED_FLAG_INDICATOR | LED_FLAG_LAYER_IND); + rgb_matrix_set_color_all(0, 0, 0); + break; + default: + isRGBOff = false; + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); // turn the lights back on + } + } + return false; + + // print firmware version + case KB_VRSN: + if (!get_mods()) { + if (!record->event.pressed) { + SEND_STRING(QMK_KEYBOARD ":" QMK_KEYMAP " (v" QMK_VERSION ")"); + } + } + return false; + + // @see: https://github.com/qmk/qmk_firmware/issues/10111#issuecomment-752300353 + case KC_MCON: + if (record->event.pressed) { + host_consumer_send(_AC_SHOW_ALL_WINDOWS); + } + return false; + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(_AC_SHOW_ALL_APPS); + } + return false; + + default: + return true; /* Process all other keycodes normally */ + } +} diff --git a/keyboards/id67/keymaps/vinorodrigues/rules.mk b/keyboards/id67/keymaps/vinorodrigues/rules.mk new file mode 100644 index 000000000000..24f7bdab9cd7 --- /dev/null +++ b/keyboards/id67/keymaps/vinorodrigues/rules.mk @@ -0,0 +1,5 @@ +LTO_ENABLE = yes +VIA_ENABLE = yes + +KEY_LOCK_ENABLE = no # Enable KC_LOCK support +NKRO_ENABLE = no # N-Key Rollover must be OFF for mac keys to work diff --git a/keyboards/id67/readme.md b/keyboards/id67/readme.md index 2303bbbe2c9b..c061db8f0301 100644 --- a/keyboards/id67/readme.md +++ b/keyboards/id67/readme.md @@ -6,9 +6,13 @@ A 65% hotswap keyboard from IDOBAO. ## ANSI support: -* Keyboard Maintainer: Tybera -* Hardware Supported: IDOBAO ID67 -* Hardware Availability: [IDOBAO website](https://www.idobao.net/products/idobao-id67-65-hot-swappable-mechanical-keyboard-kit-1) +* Keyboard Maintainer: Tybera *(fmr.)*, [thewerther](https://github.com/thewerther) *(curr.)* +* Hardware Supported: IDOBAO ID67, ID67V2, ID67 Crystal & ID67 Bestype +* Hardware Availability: IDOBAO website: +* [ID67](https://www.idobao.net/products/idobao-id67-65-hot-swappable-mechanical-keyboard-kit-1) +* [ID67V2](https://idobao.net/collections/65-layout/products/idobao-id67v2-65-hot-swappable-mechanical-keyboard-kit) +* [ID67 Crystal](https://idobao.net/collections/65-layout/products/idobao-id67-crystal-keyboard-kit-gasket-mount-version) +* [ID67 Bestype](https://idobao.net/collections/65-layout/products/idobao-id67-bestype-keyboard-kit-aluminum-with-brass-weight) ## Layout