diff options
Diffstat (limited to 'layouts/community/ergodox/drashna/keymap.c')
| -rw-r--r-- | layouts/community/ergodox/drashna/keymap.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 6ed4558e2..8308bfdaa 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -1,20 +1,3 @@ | |||
| 1 | /* | ||
| 2 | This is the keymap for the keyboard | ||
| 3 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 4 | Copyright 2015 Jack Humbert | ||
| 5 | Copyright 2017 Art Ortenburger | ||
| 6 | This program is free software: you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation, either version 2 of the License, or | ||
| 9 | (at your option) any later version. | ||
| 10 | This program is distributed in the hope that it will be useful, | ||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | GNU General Public License for more details. | ||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include QMK_KEYBOARD_H | ||
| 18 | #include "drashna.h" | 1 | #include "drashna.h" |
| 19 | 2 | ||
| 20 | #ifdef UNICODEMAP_ENABLE | 3 | #ifdef UNICODEMAP_ENABLE |
| @@ -32,6 +15,13 @@ enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; | |||
| 32 | // define layer change stuff for underglow indicator | 15 | // define layer change stuff for underglow indicator |
| 33 | bool skip_leds = false; | 16 | bool skip_leds = false; |
| 34 | 17 | ||
| 18 | /* | ||
| 19 | * The `LAYOUT_ergodox_pretty_base` macro is a template to allow the use of | ||
| 20 | * identical modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, | ||
| 21 | * etc), so that there is no need to set them up for each layout, and modify | ||
| 22 | * all of them if I want to change them. This helps to keep consistency and | ||
| 23 | * ease of use. K## is a placeholder to pass through the individual keycodes | ||
| 24 | */ | ||
| 35 | // clang-format off | 25 | // clang-format off |
| 36 | #define LAYOUT_ergodox_pretty_base( \ | 26 | #define LAYOUT_ergodox_pretty_base( \ |
| 37 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ | 27 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ |
| @@ -40,8 +30,8 @@ bool skip_leds = false; | |||
| 40 | ) \ | 30 | ) \ |
| 41 | LAYOUT_ergodox_pretty_wrapper( \ | 31 | LAYOUT_ergodox_pretty_wrapper( \ |
| 42 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ | 32 | KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ |
| 43 | KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ | 33 | LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ |
| 44 | KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ | 34 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ |
| 45 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ | 35 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ |
| 46 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ | 36 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ |
| 47 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ | 37 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ |
| @@ -402,7 +392,7 @@ void rgb_matrix_indicators_user(void) { | |||
| 402 | rgb_matrix_config.enable | 392 | rgb_matrix_config.enable |
| 403 | # endif | 393 | # endif |
| 404 | ) { | 394 | ) { |
| 405 | switch (biton32(layer_state)) { | 395 | switch (get_highest_layer(layer_state)) { |
| 406 | case _GAMEPAD: | 396 | case _GAMEPAD: |
| 407 | rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 397 | rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); |
| 408 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q | 398 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q |
| @@ -432,7 +422,7 @@ void rgb_matrix_indicators_user(void) { | |||
| 432 | break; | 422 | break; |
| 433 | default: { | 423 | default: { |
| 434 | bool mods_enabled = IS_LAYER_ON(_MODS); | 424 | bool mods_enabled = IS_LAYER_ON(_MODS); |
| 435 | switch (biton32(default_layer_state)) { | 425 | switch (get_highest_layer(default_layer_state)) { |
| 436 | case _QWERTY: | 426 | case _QWERTY: |
| 437 | rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); | 427 | rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); |
| 438 | break; | 428 | break; |
| @@ -466,7 +456,6 @@ void rgb_matrix_indicators_user(void) { | |||
| 466 | 456 | ||
| 467 | #endif // RGB_MATRIX_INIT | 457 | #endif // RGB_MATRIX_INIT |
| 468 | 458 | ||
| 469 | |||
| 470 | uint16_t get_tapping_term(uint16_t keycode) { | 459 | uint16_t get_tapping_term(uint16_t keycode) { |
| 471 | if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { | 460 | if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { |
| 472 | if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { | 461 | if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { |
