diff options
| author | Victor Pivert <76471338+piv3rt@users.noreply.github.com> | 2021-05-13 08:52:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-12 23:52:55 -0700 |
| commit | 3efd94014ff363f107c563da623259286dedad1c (patch) | |
| tree | ddc017df95e66afb67524964ced81afba1f8b043 /keyboards/dztech | |
| parent | ad0e6b6291a51252603124c9b85fea631aa10ee8 (diff) | |
| download | qmk_firmware-3efd94014ff363f107c563da623259286dedad1c.tar.gz qmk_firmware-3efd94014ff363f107c563da623259286dedad1c.zip | |
piv3rt keymap for dztech/dz60rgb (#12591)
* Create piv3rt's keymap
* Use tabs's LED as a caps lock indicator
* Fix indentation (tabs -> spaces)
* Set inital LED matrix color & mode
* Rename layers and add an RGBRST keycode
* Disable unused RGB effects
* Add RGB profiles
* Use ESC's LED as a num lock indicator
* Light up the keypad when _NUM layer is active
* Realign layers
* Remove legacy layer
* Fix CAPS key macro
* Reduce TAPPING_TERM to 100
* Change the caps LED to red and display the numlock one on special layers
* Add french accentuated caps + minor improvements on layers
* Remove left numpad
* Add french quotation marks
* Add key KC_NUBS
* Add terminal copy/paste
* Disable led profile on wakeup
* Change the default color
* Add AMD replay and record keys
* Add a MacOS layer
* Move Numpad
* Add GPLv2 license information
* Optimise custom RGB matrix
* Move keypad toggle and disable MAC led indicator
* Remove unnecessary check for RGB matrix
Diffstat (limited to 'keyboards/dztech')
| -rw-r--r-- | keyboards/dztech/dz60rgb/keymaps/piv3rt/config.h | 56 | ||||
| -rw-r--r-- | keyboards/dztech/dz60rgb/keymaps/piv3rt/keymap.c | 230 | ||||
| -rw-r--r-- | keyboards/dztech/dz60rgb/keymaps/piv3rt/rules.mk | 1 |
3 files changed, 287 insertions, 0 deletions
diff --git a/keyboards/dztech/dz60rgb/keymaps/piv3rt/config.h b/keyboards/dztech/dz60rgb/keymaps/piv3rt/config.h new file mode 100644 index 000000000..a2b29c03b --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/piv3rt/config.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* | ||
| 2 | This program is free software: you can redistribute it and/or modify | ||
| 3 | it under the terms of the GNU General Public License as published by | ||
| 4 | the Free Software Foundation, either version 2 of the License, or | ||
| 5 | (at your option) any later version. | ||
| 6 | |||
| 7 | This program is distributed in the hope that it will be useful, | ||
| 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 10 | GNU General Public License for more details. | ||
| 11 | |||
| 12 | You should have received a copy of the GNU General Public License | ||
| 13 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #pragma once | ||
| 17 | |||
| 18 | #define FORCE_NKRO | ||
| 19 | #define TAPPING_TERM 100 | ||
| 20 | |||
| 21 | #define DISABLE_RGB_MATRIX_ALPHAS_MODS | ||
| 22 | #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | ||
| 23 | #define DISABLE_RGB_MATRIX_BREATHING | ||
| 24 | #define DISABLE_RGB_MATRIX_BAND_SAT | ||
| 25 | #define DISABLE_RGB_MATRIX_BAND_VAL | ||
| 26 | #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT | ||
| 27 | #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL | ||
| 28 | #define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT | ||
| 29 | #define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL | ||
| 30 | #define DISABLE_RGB_MATRIX_CYCLE_ALL | ||
| 31 | //#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | ||
| 32 | #define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | ||
| 33 | #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
| 34 | #define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
| 35 | #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | ||
| 36 | #define DISABLE_RGB_MATRIX_DUAL_BEACON | ||
| 37 | #define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL | ||
| 38 | #define DISABLE_RGB_MATRIX_CYCLE_SPIRAL | ||
| 39 | #define DISABLE_RGB_MATRIX_RAINBOW_BEACON | ||
| 40 | #define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | ||
| 41 | #define DISABLE_RGB_MATRIX_RAINDROPS | ||
| 42 | #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | ||
| 43 | #define DISABLE_RGB_MATRIX_TYPING_HEATMAP | ||
| 44 | #define DISABLE_RGB_MATRIX_DIGITAL_RAIN | ||
| 45 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE | ||
| 46 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
| 47 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE | ||
| 48 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE | ||
| 49 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS | ||
| 50 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS | ||
| 51 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
| 52 | #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
| 53 | #define DISABLE_RGB_MATRIX_SPLASH | ||
| 54 | #define DISABLE_RGB_MATRIX_MULTISPLASH | ||
| 55 | #define DISABLE_RGB_MATRIX_SOLID_SPLASH | ||
| 56 | #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH | ||
diff --git a/keyboards/dztech/dz60rgb/keymaps/piv3rt/keymap.c b/keyboards/dztech/dz60rgb/keymaps/piv3rt/keymap.c new file mode 100644 index 000000000..b4b77b392 --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/piv3rt/keymap.c | |||
| @@ -0,0 +1,230 @@ | |||
| 1 | /* | ||
| 2 | This program is free software: you can redistribute it and/or modify | ||
| 3 | it under the terms of the GNU General Public License as published by | ||
| 4 | the Free Software Foundation, either version 2 of the License, or | ||
| 5 | (at your option) any later version. | ||
| 6 | |||
| 7 | This program is distributed in the hope that it will be useful, | ||
| 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 10 | GNU General Public License for more details. | ||
| 11 | |||
| 12 | You should have received a copy of the GNU General Public License | ||
| 13 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | #define LT_DEL LT(_RGB, KC_DEL) | ||
| 19 | #define LT_CAPS LT(_FNC, KC_CAPS) | ||
| 20 | #define LM_LALT LM(_FNC, MOD_LALT) | ||
| 21 | #define LM_NALT LM(_NUM, MOD_LALT) | ||
| 22 | #define RSFT_SL RSFT_T(KC_SLSH) | ||
| 23 | #define RALT_F6 RALT_T(KC_F6) | ||
| 24 | #define CTLINS LCTL(KC_INS) // Ctrl + Insert (terminal copy) | ||
| 25 | #define SFTINS LSFT(KC_INS) // Shift + Insert (terminal paste) | ||
| 26 | #define AMDREP LCTL(LSFT(KC_S)) // AMD Replay | ||
| 27 | #define AMDREC LCTL(LSFT(KC_E)) // AMD Record | ||
| 28 | |||
| 29 | enum piv3rt_layers { | ||
| 30 | _DEF, | ||
| 31 | _MAC, | ||
| 32 | _FNC, | ||
| 33 | _RGB, | ||
| 34 | _NUM, | ||
| 35 | }; | ||
| 36 | |||
| 37 | enum piv3rt_keycodes { | ||
| 38 | RGB_RST = SAFE_RANGE, | ||
| 39 | RGB_PCY, // Cycle through RGB profiles | ||
| 40 | RGB_000, // Turn everything off except profiles | ||
| 41 | EACUTE, // French É for Windows | ||
| 42 | CCED, // French Ç for Windows | ||
| 43 | AGRAVE, // French À for Windows | ||
| 44 | FRQLT, // French ≪ for Windows | ||
| 45 | FRQGT, // French ≫ for Windows | ||
| 46 | }; | ||
| 47 | |||
| 48 | enum piv3rt_rgbprofiles { | ||
| 49 | CSGO, | ||
| 50 | TEXT, | ||
| 51 | OFF, // Should be the last item | ||
| 52 | }; | ||
| 53 | |||
| 54 | enum piv3rt_rgbprofiles current_profile = OFF; | ||
| 55 | |||
| 56 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 57 | [_DEF] = LAYOUT( | ||
| 58 | 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, | ||
| 59 | 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, | ||
| 60 | LT_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, | ||
| 61 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_SL, KC_UP, LT_DEL, | ||
| 62 | KC_LCTL, KC_LGUI, LM_LALT, KC_SPC, RALT_F6, MO(_FNC), KC_LEFT, KC_DOWN, KC_RGHT | ||
| 63 | ), | ||
| 64 | [_MAC] = LAYOUT( | ||
| 65 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 66 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 67 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 68 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 69 | KC_LGUI, KC_LCTL, KC_LGUI, _______, _______, _______, _______, _______, _______ | ||
| 70 | ), | ||
| 71 | [_FNC] = LAYOUT( | ||
| 72 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, | ||
| 73 | _______, AGRAVE, KC_UP, EACUTE, _______, KC_INS, _______, _______, KC_UP, KC_UP, KC_PGUP, KC_HOME, KC_PSCR, KC_NUBS, | ||
| 74 | _______, KC_HOME, KC_DOWN, KC_END, CTLINS, SFTINS, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, KC_F8, | ||
| 75 | _______, _______, KC_CALC, CCED, _______, _______, _______, _______, FRQLT, FRQGT, TG(_NUM), KC_VOLU, KC_MUTE, | ||
| 76 | _______, TG(_MAC), LM_NALT, _______, KC_MPLY, _______, KC_MPRV, KC_VOLD, KC_MNXT | ||
| 77 | ), | ||
| 78 | [_RGB] = LAYOUT( | ||
| 79 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, | ||
| 80 | _______, RGB_TOG, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, _______, _______, _______, RESET, | ||
| 81 | _______, _______, _______, _______, _______, RGB_PCY, _______, _______, RGB_SPI, RGB_SPD, _______, _______, EEP_RST, | ||
| 82 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_000, _______, | ||
| 83 | _______, _______, _______, RGB_RST, _______, _______, KC_PWR, AMDREC, AMDREP | ||
| 84 | ), | ||
| 85 | [_NUM] = LAYOUT( | ||
| 86 | KC_NLCK, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, | ||
| 87 | _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, | ||
| 88 | _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, | ||
| 89 | _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, TG(_NUM), _______, _______, | ||
| 90 | _______, _______, _______, KC_PENT, _______, _______, _______, _______, _______ | ||
| 91 | ), | ||
| 92 | }; | ||
| 93 | |||
| 94 | void reset_leds(void) { | ||
| 95 | current_profile = OFF; | ||
| 96 | rgblight_enable(); | ||
| 97 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 98 | rgb_matrix_sethsv(0x6a, 0x33, 0xff); | ||
| 99 | } | ||
| 100 | |||
| 101 | void suspend_wakeup_init_user(void) { | ||
| 102 | current_profile = OFF; | ||
| 103 | } | ||
| 104 | |||
| 105 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 106 | switch (keycode) { | ||
| 107 | case RGB_RST: | ||
| 108 | if (record->event.pressed) { | ||
| 109 | reset_leds(); | ||
| 110 | } | ||
| 111 | return false; | ||
| 112 | break; | ||
| 113 | case RGB_PCY: | ||
| 114 | if (record->event.pressed) { | ||
| 115 | // Cycle through RGB profiles | ||
| 116 | current_profile = current_profile == OFF ? 0 : current_profile + 1; | ||
| 117 | } | ||
| 118 | return false; | ||
| 119 | break; | ||
| 120 | case RGB_000: | ||
| 121 | if (record->event.pressed) { | ||
| 122 | rgb_matrix_sethsv(0, 0, 0); | ||
| 123 | } | ||
| 124 | return false; | ||
| 125 | break; | ||
| 126 | case EACUTE: | ||
| 127 | if (record->event.pressed) { | ||
| 128 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P0) SS_TAP(X_P2) SS_TAP(X_P0) SS_TAP(X_P1) SS_UP(X_LALT)); | ||
| 129 | } | ||
| 130 | return false; | ||
| 131 | break; | ||
| 132 | case CCED: | ||
| 133 | if (record->event.pressed) { | ||
| 134 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P0) SS_TAP(X_P1) SS_TAP(X_P9) SS_TAP(X_P9) SS_UP(X_LALT)); | ||
| 135 | } | ||
| 136 | return false; | ||
| 137 | break; | ||
| 138 | case AGRAVE: | ||
| 139 | if (record->event.pressed) { | ||
| 140 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P0) SS_TAP(X_P1) SS_TAP(X_P9) SS_TAP(X_P2) SS_UP(X_LALT)); | ||
| 141 | } | ||
| 142 | return false; | ||
| 143 | break; | ||
| 144 | case FRQLT: | ||
| 145 | if (record->event.pressed) { | ||
| 146 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P7) SS_TAP(X_P4) SS_UP(X_LALT)); | ||
| 147 | } | ||
| 148 | return false; | ||
| 149 | break; | ||
| 150 | case FRQGT: | ||
| 151 | if (record->event.pressed) { | ||
| 152 | SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_P1) SS_TAP(X_P7) SS_TAP(X_P5) SS_UP(X_LALT)); | ||
| 153 | } | ||
| 154 | return false; | ||
| 155 | break; | ||
| 156 | } | ||
| 157 | return true; | ||
| 158 | }; | ||
| 159 | |||
| 160 | void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | ||
| 161 | led_t led_state = host_keyboard_led_state(); | ||
| 162 | |||
| 163 | if (led_state.caps_lock) { | ||
| 164 | // Tab key = 27 | ||
| 165 | RGB_MATRIX_INDICATOR_SET_COLOR(27, 0xff, 0x00, 0x00); | ||
| 166 | } | ||
| 167 | |||
| 168 | if (led_state.num_lock && (layer_state_is(_FNC) || layer_state_is(_NUM))) { | ||
| 169 | // ESC key = 13 | ||
| 170 | RGB_MATRIX_INDICATOR_SET_COLOR(13, 0xff, 0x55, 0x55); | ||
| 171 | } | ||
| 172 | |||
| 173 | if (layer_state_is(_NUM)) { | ||
| 174 | // Num pad | ||
| 175 | for (int i=0; i<3; i++) { | ||
| 176 | RGB_MATRIX_INDICATOR_SET_COLOR(3 + i, 0xff, 0x55, 0x55); | ||
| 177 | RGB_MATRIX_INDICATOR_SET_COLOR(17 + i, 0xff, 0x55, 0x55); | ||
| 178 | RGB_MATRIX_INDICATOR_SET_COLOR(30 + i, 0xff, 0x55, 0x55); | ||
| 179 | } | ||
| 180 | RGB_MATRIX_INDICATOR_SET_COLOR(43, 0xff, 0x00, 0x00); | ||
| 181 | return; | ||
| 182 | } | ||
| 183 | |||
| 184 | if (layer_state_is(_RGB)) { | ||
| 185 | // AMD record and replay | ||
| 186 | RGB_MATRIX_INDICATOR_SET_COLOR(54, 0x00, 0xff, 0x00); | ||
| 187 | RGB_MATRIX_INDICATOR_SET_COLOR(55, 0xff, 0x00, 0x00); | ||
| 188 | } | ||
| 189 | |||
| 190 | if (current_profile == CSGO) { | ||
| 191 | // Moves | ||
| 192 | RGB_MATRIX_INDICATOR_SET_COLOR(25, 0xff, 0x00, 0x00); | ||
| 193 | RGB_MATRIX_INDICATOR_SET_COLOR(39, 0xff, 0x00, 0x00); | ||
| 194 | RGB_MATRIX_INDICATOR_SET_COLOR(38, 0xff, 0x00, 0x00); | ||
| 195 | RGB_MATRIX_INDICATOR_SET_COLOR(37, 0xff, 0x00, 0x00); | ||
| 196 | |||
| 197 | // Grenades | ||
| 198 | RGB_MATRIX_INDICATOR_SET_COLOR(4, 0x00, 0xff, 0x00); | ||
| 199 | RGB_MATRIX_INDICATOR_SET_COLOR(3, 0xff, 0x66, 0x00); | ||
| 200 | RGB_MATRIX_INDICATOR_SET_COLOR(2, 0x66, 0x66, 0x22); | ||
| 201 | RGB_MATRIX_INDICATOR_SET_COLOR(1, 0xff, 0xff, 0xff); | ||
| 202 | |||
| 203 | // Primary | ||
| 204 | RGB_MATRIX_INDICATOR_SET_COLOR(18, 0xff, 0x00, 0x00); | ||
| 205 | RGB_MATRIX_INDICATOR_SET_COLOR(17, 0x99, 0x33, 0x00); | ||
| 206 | RGB_MATRIX_INDICATOR_SET_COLOR(16, 0x00, 0xff, 0x00); | ||
| 207 | |||
| 208 | // Secondary | ||
| 209 | RGB_MATRIX_INDICATOR_SET_COLOR(32, 0x66, 0x66, 0x22); | ||
| 210 | RGB_MATRIX_INDICATOR_SET_COLOR(31, 0x00, 0x00, 0xff); | ||
| 211 | |||
| 212 | // Equipment | ||
| 213 | RGB_MATRIX_INDICATOR_SET_COLOR(30, 0xff, 0x00, 0xff); | ||
| 214 | RGB_MATRIX_INDICATOR_SET_COLOR(29, 0x00, 0x00, 0xff); | ||
| 215 | RGB_MATRIX_INDICATOR_SET_COLOR(28, 0x33, 0x66, 0x99); | ||
| 216 | RGB_MATRIX_INDICATOR_SET_COLOR(0, 0x33, 0x66, 0x99); | ||
| 217 | } else if (current_profile == TEXT) { | ||
| 218 | // Letters | ||
| 219 | for (int i=0; i<7; i++) { | ||
| 220 | RGB_MATRIX_INDICATOR_SET_COLOR(17 + i, 0x33, 0x66, 0x99); | ||
| 221 | RGB_MATRIX_INDICATOR_SET_COLOR(31 + i, 0x33, 0x66, 0x99); | ||
| 222 | RGB_MATRIX_INDICATOR_SET_COLOR(46 + i, 0x33, 0x66, 0x99); | ||
| 223 | } | ||
| 224 | RGB_MATRIX_INDICATOR_SET_COLOR(38, 0x33, 0x66, 0x99); | ||
| 225 | RGB_MATRIX_INDICATOR_SET_COLOR(39, 0x33, 0x66, 0x99); | ||
| 226 | RGB_MATRIX_INDICATOR_SET_COLOR(24, 0x33, 0x66, 0x99); | ||
| 227 | RGB_MATRIX_INDICATOR_SET_COLOR(25, 0x33, 0x66, 0x99); | ||
| 228 | RGB_MATRIX_INDICATOR_SET_COLOR(26, 0x33, 0x66, 0x99); | ||
| 229 | } | ||
| 230 | } | ||
diff --git a/keyboards/dztech/dz60rgb/keymaps/piv3rt/rules.mk b/keyboards/dztech/dz60rgb/keymaps/piv3rt/rules.mk new file mode 100644 index 000000000..23a763243 --- /dev/null +++ b/keyboards/dztech/dz60rgb/keymaps/piv3rt/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| NKRO_ENABLE = yes | |||
