diff options
| author | Hybrid <62749953+Hybrid2288@users.noreply.github.com> | 2020-06-18 03:32:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-17 18:32:02 -0700 |
| commit | 8018f4db2d6d2af506ba0f405b7ce0484799db02 (patch) | |
| tree | 72d142f7d9c1dd46392ae39f94f1206a30231ef2 | |
| parent | 1a159a38ed127fa80762a7c1b8150ba19ac34ddf (diff) | |
| download | qmk_firmware-8018f4db2d6d2af506ba0f405b7ce0484799db02.tar.gz qmk_firmware-8018f4db2d6d2af506ba0f405b7ce0484799db02.zip | |
[Keymap] new keymap for XD75 (#8675)
Co-authored-by: grousselle <grousselle@WX-OR6215570.ad.francetelecom.fr>
| -rw-r--r-- | keyboards/xd75/keymaps/hybrid/config.h | 20 | ||||
| -rw-r--r-- | keyboards/xd75/keymaps/hybrid/keymap.c | 310 | ||||
| -rw-r--r-- | keyboards/xd75/keymaps/hybrid/readme.md | 13 | ||||
| -rw-r--r-- | keyboards/xd75/keymaps/hybrid/rules.mk | 21 |
4 files changed, 364 insertions, 0 deletions
diff --git a/keyboards/xd75/keymaps/hybrid/config.h b/keyboards/xd75/keymaps/hybrid/config.h new file mode 100644 index 000000000..8aa116d99 --- /dev/null +++ b/keyboards/xd75/keymaps/hybrid/config.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* Copyright 2017 Benjamin Kesselring | ||
| 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 TAPPING_TERM 170 | ||
| 19 | //#define RGBLIGHT_LAYERS | ||
| 20 | // place overrides here | ||
diff --git a/keyboards/xd75/keymaps/hybrid/keymap.c b/keyboards/xd75/keymaps/hybrid/keymap.c new file mode 100644 index 000000000..e8b5a3536 --- /dev/null +++ b/keyboards/xd75/keymaps/hybrid/keymap.c | |||
| @@ -0,0 +1,310 @@ | |||
| 1 | /* Copyright 2020 Hybrid | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | |||
| 19 | enum layers { | ||
| 20 | _MAIN = 0, | ||
| 21 | _LY1, | ||
| 22 | _LY2, | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum { | ||
| 26 | TD_A, | ||
| 27 | TD_E, | ||
| 28 | TD_I, | ||
| 29 | TD_O, | ||
| 30 | TD_U, | ||
| 31 | TD_SLASH, | ||
| 32 | TD_UNDER, | ||
| 33 | TD_OP_ACCOL, | ||
| 34 | TD_CL_ACCOL, | ||
| 35 | TD_QUESTION, | ||
| 36 | TD_CEDILLE, | ||
| 37 | TD_DOT, | ||
| 38 | }; | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | void dance_a_accent (qk_tap_dance_state_t *state, void *user_data) { | ||
| 43 | if (state->count == 2) { | ||
| 44 | tap_code (KC_0); | ||
| 45 | } | ||
| 46 | else { | ||
| 47 | tap_code (KC_Q); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | void dance_e_accent (qk_tap_dance_state_t *state, void *user_data) { | ||
| 51 | if (state->count == 2) { | ||
| 52 | tap_code (KC_2); | ||
| 53 | } | ||
| 54 | else if (state->count == 3) { | ||
| 55 | tap_code (KC_7); | ||
| 56 | } | ||
| 57 | else { | ||
| 58 | tap_code (KC_E); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | void dance_i_accent (qk_tap_dance_state_t *state, void *user_data) { | ||
| 62 | if (state->count == 2) { | ||
| 63 | tap_code (KC_NLCK); | ||
| 64 | register_code (KC_LALT); | ||
| 65 | tap_code (KC_P0); | ||
| 66 | tap_code (KC_P2); | ||
| 67 | tap_code (KC_P3); | ||
| 68 | tap_code (KC_P8); | ||
| 69 | unregister_code (KC_LALT); | ||
| 70 | tap_code (KC_NLCK); | ||
| 71 | } | ||
| 72 | else { | ||
| 73 | tap_code (KC_I); | ||
| 74 | |||
| 75 | } | ||
| 76 | } | ||
| 77 | void dance_o_accent (qk_tap_dance_state_t *state, void *user_data) { | ||
| 78 | if (state->count == 2) { | ||
| 79 | tap_code (KC_NLCK); | ||
| 80 | register_code (KC_LALT); | ||
| 81 | tap_code (KC_P0); | ||
| 82 | tap_code (KC_P2); | ||
| 83 | tap_code (KC_P4); | ||
| 84 | tap_code (KC_P4); | ||
| 85 | unregister_code (KC_LALT); | ||
| 86 | tap_code (KC_NLCK); | ||
| 87 | } | ||
| 88 | else { | ||
| 89 | tap_code (KC_O); | ||
| 90 | } | ||
| 91 | } | ||
| 92 | void dance_u_accent (qk_tap_dance_state_t *state, void *user_data) { | ||
| 93 | if (state->count == 2) { | ||
| 94 | tap_code (KC_NLCK); | ||
| 95 | register_code (KC_LALT); | ||
| 96 | tap_code (KC_P0); | ||
| 97 | tap_code (KC_P2); | ||
| 98 | tap_code (KC_P4); | ||
| 99 | tap_code (KC_P9); | ||
| 100 | unregister_code (KC_LALT); | ||
| 101 | tap_code (KC_NLCK); | ||
| 102 | } | ||
| 103 | else { | ||
| 104 | tap_code (KC_U); | ||
| 105 | } | ||
| 106 | |||
| 107 | } | ||
| 108 | void dance_slash (qk_tap_dance_state_t *state, void *user_data) { | ||
| 109 | if (state->count == 2) { | ||
| 110 | tap_code (KC_NLCK); | ||
| 111 | register_code (KC_LALT); | ||
| 112 | tap_code (KC_P0); | ||
| 113 | tap_code (KC_P9); | ||
| 114 | tap_code (KC_P2); | ||
| 115 | unregister_code (KC_LALT); | ||
| 116 | tap_code (KC_NLCK); | ||
| 117 | } | ||
| 118 | else { | ||
| 119 | tap_code (KC_PSLS); | ||
| 120 | } | ||
| 121 | } | ||
| 122 | void dance_under (qk_tap_dance_state_t *state, void *user_data) { | ||
| 123 | if (state->count == 2) { | ||
| 124 | tap_code (KC_NLCK); | ||
| 125 | register_code (KC_LALT); | ||
| 126 | tap_code (KC_P0); | ||
| 127 | tap_code (KC_P9); | ||
| 128 | tap_code (KC_P5); | ||
| 129 | unregister_code (KC_LALT); | ||
| 130 | tap_code (KC_NLCK); | ||
| 131 | } | ||
| 132 | else { | ||
| 133 | tap_code (KC_6); | ||
| 134 | } | ||
| 135 | } | ||
| 136 | void dance_open_accol (qk_tap_dance_state_t *state, void *user_data) { | ||
| 137 | if (state->count == 2) { | ||
| 138 | tap_code (KC_NLCK); | ||
| 139 | register_code (KC_LALT); | ||
| 140 | tap_code (KC_P0); | ||
| 141 | tap_code (KC_P1); | ||
| 142 | tap_code (KC_P2); | ||
| 143 | tap_code (KC_P3); | ||
| 144 | unregister_code (KC_LALT); | ||
| 145 | tap_code (KC_NLCK); | ||
| 146 | } | ||
| 147 | else if (state->count == 3) { | ||
| 148 | tap_code (KC_NLCK); | ||
| 149 | register_code (KC_LALT); | ||
| 150 | tap_code (KC_P0); | ||
| 151 | tap_code (KC_P9); | ||
| 152 | tap_code (KC_P1); | ||
| 153 | unregister_code (KC_LALT); | ||
| 154 | tap_code (KC_NLCK); | ||
| 155 | } | ||
| 156 | else { | ||
| 157 | tap_code (KC_5); | ||
| 158 | } | ||
| 159 | } | ||
| 160 | void dance_close_accol (qk_tap_dance_state_t *state, void *user_data) { | ||
| 161 | if (state->count == 2) { | ||
| 162 | tap_code (KC_NLCK); | ||
| 163 | register_code (KC_LALT); | ||
| 164 | tap_code (KC_P0); | ||
| 165 | tap_code (KC_P1); | ||
| 166 | tap_code (KC_P2); | ||
| 167 | tap_code (KC_P5); | ||
| 168 | unregister_code (KC_LALT); | ||
| 169 | tap_code (KC_NLCK); | ||
| 170 | |||
| 171 | } | ||
| 172 | else if (state->count == 3) { | ||
| 173 | tap_code (KC_NLCK); | ||
| 174 | register_code (KC_LALT); | ||
| 175 | tap_code (KC_P0); | ||
| 176 | tap_code (KC_P9); | ||
| 177 | tap_code (KC_P3); | ||
| 178 | unregister_code (KC_LALT); | ||
| 179 | tap_code (KC_NLCK); | ||
| 180 | } | ||
| 181 | else { | ||
| 182 | tap_code (KC_MINS); | ||
| 183 | } | ||
| 184 | } | ||
| 185 | void dance_question (qk_tap_dance_state_t *state, void *user_data) { | ||
| 186 | if (state->count == 2) { | ||
| 187 | tap_code (KC_NLCK); | ||
| 188 | register_code (KC_LALT); | ||
| 189 | tap_code (KC_P0); | ||
| 190 | tap_code (KC_P0); | ||
| 191 | tap_code (KC_P3); | ||
| 192 | tap_code (KC_P3); | ||
| 193 | unregister_code (KC_LALT); | ||
| 194 | tap_code (KC_NLCK); | ||
| 195 | |||
| 196 | } | ||
| 197 | else { | ||
| 198 | tap_code (KC_NLCK); | ||
| 199 | register_code (KC_LALT); | ||
| 200 | tap_code (KC_P0); | ||
| 201 | tap_code (KC_P0); | ||
| 202 | tap_code (KC_P6); | ||
| 203 | tap_code (KC_P3); | ||
| 204 | unregister_code (KC_LALT); | ||
| 205 | tap_code (KC_NLCK); | ||
| 206 | |||
| 207 | } | ||
| 208 | } | ||
| 209 | void dance_cedille (qk_tap_dance_state_t *state, void *user_data) { | ||
| 210 | if (state->count == 2) { | ||
| 211 | tap_code (KC_9); | ||
| 212 | } | ||
| 213 | else { | ||
| 214 | tap_code (KC_C); | ||
| 215 | } | ||
| 216 | } | ||
| 217 | void dance_dot (qk_tap_dance_state_t *state, void *user_data) { | ||
| 218 | if (state->count == 2) { | ||
| 219 | tap_code (KC_NLCK); | ||
| 220 | register_code (KC_LALT); | ||
| 221 | tap_code (KC_P0); | ||
| 222 | tap_code (KC_P4); | ||
| 223 | tap_code (KC_P4); | ||
| 224 | unregister_code (KC_LALT); | ||
| 225 | tap_code (KC_NLCK); | ||
| 226 | } | ||
| 227 | else { | ||
| 228 | tap_code (KC_NLCK); | ||
| 229 | register_code (KC_LALT); | ||
| 230 | tap_code (KC_P0); | ||
| 231 | tap_code (KC_P4); | ||
| 232 | tap_code (KC_P6); | ||
| 233 | unregister_code (KC_LALT); | ||
| 234 | tap_code (KC_NLCK); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 238 | [TD_A] = ACTION_TAP_DANCE_FN(dance_a_accent), | ||
| 239 | [TD_E] = ACTION_TAP_DANCE_FN(dance_e_accent), | ||
| 240 | [TD_I] = ACTION_TAP_DANCE_FN(dance_i_accent), | ||
| 241 | [TD_O] = ACTION_TAP_DANCE_FN(dance_o_accent), | ||
| 242 | [TD_U] = ACTION_TAP_DANCE_FN(dance_u_accent), | ||
| 243 | [TD_SLASH] = ACTION_TAP_DANCE_FN(dance_slash), | ||
| 244 | [TD_UNDER] = ACTION_TAP_DANCE_FN(dance_under), | ||
| 245 | [TD_OP_ACCOL] = ACTION_TAP_DANCE_FN(dance_open_accol), | ||
| 246 | [TD_CL_ACCOL] = ACTION_TAP_DANCE_FN(dance_close_accol), | ||
| 247 | [TD_QUESTION] = ACTION_TAP_DANCE_FN(dance_question), | ||
| 248 | [TD_CEDILLE] = ACTION_TAP_DANCE_FN(dance_cedille), | ||
| 249 | [TD_DOT] = ACTION_TAP_DANCE_FN(dance_dot), | ||
| 250 | }; | ||
| 251 | |||
| 252 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 253 | |||
| 254 | // red led layout | ||
| 255 | [_MAIN] = LAYOUT_ortho_5x15( | ||
| 256 | KC_ESC, KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, TD(TD_DOT), KC_6, KC_7, KC_8, KC_9, KC_0, DF(_LY1), KC_NO, | ||
| 257 | KC_TAB, TD(TD_A), KC_W, TD(TD_E), KC_R, KC_T, KC_Y, KC_ENT, TD(TD_U), TD(TD_I), TD(TD_O), KC_P, KC_NO, TD(TD_OP_ACCOL), TD(TD_CL_ACCOL), | ||
| 258 | KC_PGUP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_ENT, KC_J, KC_K, KC_L, KC_SCLN, KC_UP, KC_NO, KC_NO, | ||
| 259 | KC_PGDN, KC_Z, KC_X, TD(TD_CEDILLE), KC_V, KC_B, KC_N, KC_DOT, TD(TD_QUESTION), TD(TD_UNDER), TD(TD_SLASH), KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, | ||
| 260 | KC_NO, KC_NO, KC_LALT, KC_LCTL, KC_LSFT, KC_SPC, KC_HOME, KC_LGUI, KC_END, KC_BSPC, KC_RALT, KC_DEL, KC_PMNS, KC_NO, MO(1) | ||
| 261 | ), | ||
| 262 | |||
| 263 | // green led layout | ||
| 264 | [_LY1] = LAYOUT_ortho_5x15( | ||
| 265 | KC_ESC, RGB_TOG, RGB_RMOD, RGB_M_P, RGB_M_B, RGB_M_SW, RGB_M_K, RGB_M_G, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_LY2), DF(_MAIN), | ||
| 266 | DEBUG, KC_PSCR, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, | ||
| 267 | RESET, KC_NO, KC_S, KC_D, KC_F, KC_G, KC_Z, KC_J, KC_K, KC_L, KC_M, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_LSFT, | ||
| 268 | KC_NO, KC_X, KC_C, KC_V, KC_B, KC_N, KC_COMM, KC_SCLN, KC_NO, KC_NO, KC_P4, KC_P5, KC_P6, KC_PEQL, KC_LCBR, | ||
| 269 | KC_NO, KC_NO, KC_NO, KC_SPC, KC_SPC, KC_SPC, KC_TRNS, KC_NO, KC_TRNS, KC_P0, KC_P1, KC_P2, KC_P3, KC_TRNS | ||
| 270 | ), | ||
| 271 | |||
| 272 | // blue led layout | ||
| 273 | [_LY2] = LAYOUT_ortho_5x15( | ||
| 274 | KC_MPRV, KC_MNXT, KC_NO, KC_NO, KC_NO, BL_ON, BL_OFF, KC_NO, KC_NO, KC_NO, RGB_TOG, RGB_RMOD, RGB_MOD, KC_NO, DF(_LY1), | ||
| 275 | KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUD, RGB_HUI, RGB_M_P, RGB_M_B, | ||
| 276 | KC_MPLY, KC_MSTP, KC_MUTE, KC_NO, KC_NO, BL_DEC, BL_INC, KC_NO, KC_NO, KC_NO, KC_NO, RGB_SAD, RGB_SAI, RGB_M_R, RGB_M_SW, | ||
| 277 | KC_MRWD, KC_MFFD, KC_NO, KC_NO, KC_NO, BL_BRTG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_VAD, RGB_VAI, RGB_M_SN, RGB_M_K, | ||
| 278 | KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, RGB_SPD, RGB_SPI, RGB_M_X, RGB_M_G | ||
| 279 | ) | ||
| 280 | |||
| 281 | }; | ||
| 282 | |||
| 283 | |||
| 284 | //Define layer colors | ||
| 285 | #define rgblight_setrgb_user_MAIN() rgblight_sethsv_red() | ||
| 286 | #define rgblight_setrgb_user_LY1() rgblight_sethsv_green() | ||
| 287 | #define rgblight_setrgb_user_LY2() rgblight_sethsv_blue() | ||
| 288 | |||
| 289 | void matrix_init_user(void) { | ||
| 290 | rgblight_enable(); | ||
| 291 | rgblight_mode(1); | ||
| 292 | rgblight_setrgb_user_MAIN(); | ||
| 293 | } | ||
| 294 | |||
| 295 | |||
| 296 | //Set a color based on the layer | ||
| 297 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 298 | switch (get_highest_layer(state)) { | ||
| 299 | case _LY1: | ||
| 300 | rgblight_setrgb_user_LY1(); | ||
| 301 | break; | ||
| 302 | case _LY2: | ||
| 303 | rgblight_setrgb_user_LY2(); | ||
| 304 | break; | ||
| 305 | default: | ||
| 306 | rgblight_setrgb_user_MAIN(); | ||
| 307 | break; | ||
| 308 | } | ||
| 309 | return state; | ||
| 310 | } | ||
diff --git a/keyboards/xd75/keymaps/hybrid/readme.md b/keyboards/xd75/keymaps/hybrid/readme.md new file mode 100644 index 000000000..dbe41037c --- /dev/null +++ b/keyboards/xd75/keymaps/hybrid/readme.md | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # | ||
| 2 | # My XD75 keyboard | ||
| 3 | # The layouts are 100 % customizable by myself. | ||
| 4 | # The layout 1 is almost finished (layer 2 and layer 3 are not finished, for testing purpose as far) | ||
| 5 | # Layout 1 => rgb red | ||
| 6 | # Layout 2 => rgb green | ||
| 7 | # Layout 1 => rgb blue | ||
| 8 | # (to memorize => rgb :) ) | ||
| 9 | # | ||
| 10 | # I added some double tap dance for french accent (à é è î ô ù, not for every accents) and c & ç | ||
| 11 | # Some double tap dance for useful mapping (- & _ , ({[ & )}], etc... ) | ||
| 12 | # | ||
| 13 | # | ||
diff --git a/keyboards/xd75/keymaps/hybrid/rules.mk b/keyboards/xd75/keymaps/hybrid/rules.mk new file mode 100644 index 000000000..403c3c65c --- /dev/null +++ b/keyboards/xd75/keymaps/hybrid/rules.mk | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | # Copyright 2013 Jun Wako <wakojun@gmail.com> | ||
| 2 | # | ||
| 3 | # This program is free software: you can redistribute it and/or modify | ||
| 4 | # it under the terms of the GNU General Public License as published by | ||
| 5 | # the Free Software Foundation, either version 2 of the License, or | ||
| 6 | # (at your option) any later version. | ||
| 7 | # | ||
| 8 | # This program is distributed in the hope that it will be useful, | ||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | # GNU General Public License for more details. | ||
| 12 | # | ||
| 13 | # You should have received a copy of the GNU General Public License | ||
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | |||
| 16 | RGBLIGHT_ENABLE = yes | ||
| 17 | TAP_DANCE_ENABLE = yes | ||
| 18 | UNICODE_ENABLE = no | ||
| 19 | SLEEP_LED_ENABLE = no | ||
| 20 | BACKLIGHT_ENABLE = no | ||
| 21 | |||
