qmk

QMK Firmware
git clone git://git.z3bra.org/qmk.git
Log | Files | Refs | Submodules | LICENSE

keymap.c (30856B)


      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"
     19 
     20 #ifdef UNICODEMAP_ENABLE
     21 #    include "drashna_unicode.h"
     22 #endif  // UNICODEMAP_ENABLE
     23 #ifndef UNICODE_ENABLE
     24 #    define UC(x) KC_NO
     25 #endif
     26 
     27 extern userspace_config_t userspace_config;
     28 
     29 enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE };
     30 
     31 // define layer change stuff for underglow indicator
     32 bool skip_leds = false;
     33 
     34 // clang-format off
     35 #define LAYOUT_ergodox_pretty_base( \
     36     K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
     37     K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
     38     K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A  \
     39   ) \
     40   LAYOUT_ergodox_pretty_wrapper( \
     41       KC_ESC,  ________________NUMBER_LEFT________________, UC_FLIP,                 UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \
     42       KC_TAB,  K01,    K02,     K03,      K04,     K05,     TG(_DIABLO),         TG(_DIABLO), K06,     K07,     K08,     K09,     K0A,     KC_BSLS, \
     43       KC_C1R3, K11,    K12,     K13,      K14,     K15,                                       K16,     K17,     K18,     K19,     K1A,     KC_QUOT, \
     44       KC_MLSF, CTL_T(K21), K22, K23,      K24,     K25,     TG(_GAMEPAD),       TG(_GAMEPAD), K26,     K27,     K28,     K29,  RCTL_T(K2A), KC_MRSF, \
     45       KC_GRV,  OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC,                                            KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT, UC(0x2E2E),        \
     46                                                   OS_LALT, OS_LGUI,                 OS_RGUI, CTL_T(KC_ESCAPE),                                      \
     47                                                            KC_APP,                  KC_MENU,                                                        \
     48                               KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR,                  OS_RSE, LT(_RAISE, KC_DEL), KC_ENT                              \
     49     )
     50 
     51 #define LAYOUT_ergodox_pretty_base_wrapper(...)       LAYOUT_ergodox_pretty_base(__VA_ARGS__)
     52 
     53 
     54 
     55 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     56 /* Keymap 0: QWERTY Layer
     57  *
     58  *
     59  * ,--------------------------------------------------.           ,--------------------------------------------------.
     60  * |   = +  |  1 ! | 2 @  | 3 #  | 4 $  | 5 %  | TG(4)|           | TG(4)| 6 ^  | 7 &  |  8 * | 9 (  |  0 ) |  - _   |
     61  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
     62  * |   TAB  |   Q  |   W  |   E  |   R  |   T  | TG(3)|           |TG(3) |   Y  |   U  |   I  |   O  |   P  |  \ |   |
     63  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
     64  * |  Bksp  |   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   ;  |  ' "   |
     65  * |--------+------+------+------+------+------| TG(2)|           | TG(2)|------+------+------+------+------+--------|
     66  * | Shift  |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |  , < |  . > |  ? / | Shift  |
     67  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
     68  *   | `/SYM|  MEH | LGUI |  [ { | ] }  |                                       | LEFT | DOWN |  UP  |RIGHT | SYMB |
     69  *   `----------------------------------'                                       `----------------------------------'
     70  *                                        ,--------------.       ,--------------.
     71  *                                        |Alt/Ap|  Win  |       | Alt  |Ctl/Esc|
     72  *                                 ,------|------|-------|       |------+-------+------.
     73  *                                 |      |      | Home  |       | PgUp |       |      |
     74  *                                 | Space| Bksp |-------|       |------|  DEL  |Enter |
     75  *                                 |      |      | End   |       | PgDn |       |      |
     76  *                                 `---------------------'       `---------------------'
     77  */
     78   [_QWERTY] = LAYOUT_ergodox_pretty_base_wrapper(
     79     _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
     80     _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
     81     _________________QWERTY_L3_________________, _________________QWERTY_R3_________________
     82   ),
     83 /* Keymap 0: COLEMAK layer
     84  *
     85  * ,--------------------------------------------------.           ,--------------------------------------------------.
     86  * |   =    |   1  |   2  |   3  |   4  |   5  | LEFT |           | RIGHT|   6  |   7  |   8  |   9  |   0  |   -    |
     87  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
     88  * | Del    |   Q  |   W  |   F  |   P  |   G  |  L1  |           |  L1  |   J  |   L  |   U  |   Y  |   ;  |   \    |
     89  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
     90  * | BkSp   |   A  |   R  |   S  |   T  |   D  |------|           |------|   H  |   N  |   E  |   I  |O / L2|   '    |
     91  * |--------+------+------+------+------+------| OVER |           | Meh  |------+------+------+------+------+--------|
     92  * | LShift |Z/Ctrl|   X  |   C  |   V  |   B  |      |           |      |   K  |   M  |   ,  |   .  |//Ctrl| RShift |
     93  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
     94  *   | `/SYM|  MEH | LGUI |  [ { | ] }  |                                       | LEFT | DOWN |  UP  |RIGHT | SYMB |
     95  *   `----------------------------------'                                       `----------------------------------'
     96  *                                        ,-------------.       ,-------------.
     97  *                                        | App  | LGui |       | Alt  |Ctrl/Esc|
     98  *                                 ,------|------|------|       |------+--------+------.
     99  *                                 |      |      | Home |       | PgUp |        |      |
    100  *                                 | Space|Backsp|------|       |------|  Tab   |Enter |
    101  *                                 |      |ace   | End  |       | PgDn |        |      |
    102  *                                 `--------------------'       `----------------------'
    103  */
    104 // If it accepts an argument (i.e, is a function), it doesn't need KC_.
    105 // Otherwise, it needs KC_*
    106   [_COLEMAK] = LAYOUT_ergodox_pretty_base_wrapper(
    107     _________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
    108     _________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
    109     _________________COLEMAK_L3________________, _________________COLEMAK_R3________________
    110   ),
    111 /* Keymap 0: DVORAK Layout
    112  *
    113  * ,--------------------------------------------------.           ,--------------------------------------------------.
    114  * |   =    |   1  |   2  |   3  |   4  |   5  | LEFT |           | RIGHT|   6  |   7  |   8  |   9  |   0  |   \    |
    115  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
    116  * | Del    |   '  |   ,  |   .  |   P  |   Y  |  L1  |           |  L1  |   F  |   G  |   C  |   R  |   L  |   /    |
    117  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
    118  * | BkSp   |   A  |   O  |   E  |   U  |   I  |------|           |------|   D  |   H  |   T  |   N  |S / L2|   -    |
    119  * |--------+------+------+------+------+------| Hyper|           | Meh  |------+------+------+------+------+--------|
    120  * | LShift |:/Ctrl|   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |Z/Ctrl| RShift |
    121  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
    122  *   | `/SYM|  MEH | LGUI |  [ { | ] }  |                                       | LEFT | DOWN |  UP  |RIGHT | SYMB |
    123  *   `----------------------------------'                                       `----------------------------------'
    124  *                                        ,-------------.       ,-------------.
    125  *                                        | App  | LGui |       | Alt  |Ctrl/Esc|
    126  *                                 ,------|------|------|       |------+--------+------.
    127  *                                 |      |      | Home |       | PgUp |        |      |
    128  *                                 | Space|Backsp|------|       |------|  Tab   |Enter |
    129  *                                 |      |ace   | End  |       | PgDn |        |      |
    130  *                                 `--------------------'       `----------------------'
    131  */
    132 // If it accepts an argument (i.e, is a function), it doesn't need KC_.
    133 // Otherwise, it needs KC_*
    134   [_DVORAK] = LAYOUT_ergodox_pretty_base_wrapper(
    135     _________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
    136     _________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
    137     _________________DVORAK_L3_________________, _________________DVORAK_R3_________________
    138   ),
    139 /* Keymap 0: WORKMAN layer
    140  *
    141  * ,--------------------------------------------------.           ,--------------------------------------------------.
    142  * |   =    |   1  |   2  |   3  |   4  |   5  | LEFT |           | RIGHT|   6  |   7  |   8  |   9  |   0  |   -    |
    143  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
    144  * | Del    |   Q  |   D  |   R  |   W  |   B  |  L1  |           |  L1  |   J  |   F  |   U  |   P  |   ;  |   \    |
    145  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
    146  * | BkSp   |   A  |   S  |   H  |   T  |   D  |------|           |------|   Y  |   N  |   E  |   O  |   I  |   '    |
    147  * |--------+------+------+------+------+------| OVER |           | Meh  |------+------+------+------+------+--------|
    148  * | LShift |Z/Ctrl|   X  |   M  |   C  |   V  |      |           |      |   K  |   L  |   ,  |   .  |//Ctrl| RShift |
    149  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
    150  *   | `/SYM|  MEH | LGUI |  [ { | ] }  |                                       | LEFT | DOWN |  UP  |RIGHT | SYMB |
    151  *   `----------------------------------'                                       `----------------------------------'
    152  *                                        ,-------------.       ,-------------.
    153  *                                        | App  | LGui |       | Alt  |Ctrl/Esc|
    154  *                                 ,------|------|------|       |------+--------+------.
    155  *                                 |      |      | Home |       | PgUp |        |      |
    156  *                                 | Space|Backsp|------|       |------|  Tab   |Enter |
    157  *                                 |      |ace   | End  |       | PgDn |        |      |
    158  *                                 `--------------------'       `----------------------'
    159  */
    160 
    161   [_WORKMAN] = LAYOUT_ergodox_pretty_base_wrapper(
    162     _________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
    163     _________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
    164     _________________WORKMAN_L3________________, _________________WORKMAN_R3________________
    165   ),
    166 
    167   [_NORMAN] = LAYOUT_ergodox_pretty_base_wrapper(
    168     _________________NORMAN_L1_________________, _________________NORMAN_L1_________________,
    169     _________________NORMAN_L2_________________, _________________NORMAN_R2_________________,
    170     _________________NORMAN_L3_________________, _________________NORMAN_R3_________________
    171   ),
    172 
    173   [_MALTRON] = LAYOUT_ergodox_pretty_base_wrapper(
    174     _________________MALTRON_L1________________, _________________MALTRON_R1________________,
    175     _________________MALTRON_L2________________, _________________MALTRON_R2________________,
    176     _________________MALTRON_L3________________, _________________MALTRON_R3________________
    177   ),
    178 
    179   [_EUCALYN] = LAYOUT_ergodox_pretty_base_wrapper(
    180     _________________EUCALYN_L1________________, _________________EUCALYN_R1________________,
    181     _________________EUCALYN_L2________________, _________________EUCALYN_R2________________,
    182     _________________EUCALYN_L3________________, _________________EUCALYN_R3________________
    183   ),
    184 
    185   [_CARPLAX] = LAYOUT_ergodox_pretty_base_wrapper(
    186     _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________,
    187     _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________,
    188     _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________
    189   ),
    190 
    191 
    192 // Reverts OSM(Shift) to normal Shifts. However, may not need since we fixed the issue with RDP (LOCAL RESOURCES)
    193   [_MODS] = LAYOUT_ergodox_pretty_wrapper(
    194              _______, _______, _______, _______, _______, _______, _______,                 _______, _______, _______, _______, _______, _______, _______,
    195              _______, _______, _______, _______, _______, _______, _______,                 _______, _______, _______, _______, _______, _______, _______,
    196              _______, _______, _______, _______, _______, _______,                                   _______, _______, _______, _______, _______, _______,
    197              KC_LSFT, _______, _______, _______, _______, _______, _______,                 _______, _______, _______, _______, _______, _______, KC_RSFT,
    198              _______, _______, _______, _______, _______,                                                     _______, _______, _______, _______, _______,
    199                                                           _______, _______,                 _______, _______,
    200                                                                    _______,                 _______,
    201                                                  _______, _______, _______,                 _______, _______, _______
    202             ),
    203 
    204 
    205 /* Keymap 4: Customized Overwatch Layout
    206  *
    207  * ,--------------------------------------------------.           ,--------------------------------------------------.
    208  * |   ESC  |      |      |      |      |      |      |           |      |  F9  | F10  | F11  |  F12 |      |        |
    209  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
    210  * |   F1   |  K   |  Q   |  W   |  E   |  R   |  T   |           |      |      |      |      |      |      |        |
    211  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
    212  * |   TAB  |  G   |  A   |  S   |  D   |  F   |------|           |------|      |      |      |      |      |        |
    213  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
    214  * |  LCTR  | LSHFT|  Z   |  X   |  C   |  V   |      |           |      |   N  |  M   |      |      |      |        |
    215  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
    216  *   |   J  |  U   |  I   |  Y   |  T   |                                       |      |      |      |      |      |
    217  *   `----------------------------------'                                       `----------------------------------'
    218  *                                        ,-------------.       ,-------------.
    219  *                                        |  O   |  P   |       |      |      |
    220  *                                 ,------|------|------|       |------+------+------.
    221  *                                 |      |      | LGUI |       |      |      |      |
    222  *                                 |  V   | SPACE|------        |------|      | Enter|
    223  *                                 |      |      |  H   |       |      |      |      |
    224  *                                 `--------------------'       `--------------------'
    225  */
    226   [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper(
    227              KC_ESC,  KC_NO,   KC_1,    KC_2,    KC_3, HYPR(KC_Q), HYPR(KC_GRV),            KC_TRNS, KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NO,   KC_NO,
    228              KC_F1,   KC_K,    KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,                    UC_SHRG, UC_DISA, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,
    229              KC_TAB,  KC_G,    KC_A,    KC_S,    KC_D,    KC_F,                                      KC_I,    KC_O,    KC_NO,   KC_NO,   KC_NO,   KC_NO,
    230              KC_LCTL, KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_TRNS,            TG(_GAMEPAD), KC_N,    KC_M,    KC_NO,   KC_NO,   KC_NO,   KC_NO,
    231              KC_GRV,  KC_U,    KC_I,    KC_Y,    KC_T,                                                        KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT, KC_NO,
    232                                                           KC_O,    KC_P,                    MAGIC_TOGGLE_NKRO, LALT(KC_PSCR),
    233                                                                    KC_LGUI,                 KC_HYPR,
    234                                                  KC_V,    KC_SPC,  KC_H,                    KC_NO, KC_NO,  KC_SWAP_NUM
    235             ),
    236 
    237 /* Keymap 3:
    238  *
    239  * ,--------------------------------------------------.           ,--------------------------------------------------.
    240  * |   ESC  |  V   |  D   | ALT  |      |      |      |           |      |      |      |      |      |      |        |
    241  * |--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
    242  * |   TAB  |  S   |  I   |  F   |  M   |  T   |      |           |      |      |      |      |      |      |        |
    243  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
    244  * |    Q   |  1   |  2   |  3   |  4   |  G   |------|           |------|      |      |      |      |      |        |
    245  * |--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
    246  * | NUMLOCK| NUM1 | NUM2 | NUM3 | NUM4 |  Z   |      |           |      |      |      |      |      |      |        |
    247  * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
    248  *   | LCTL | MAC1 | MAC2 | MAC3 | MAC4 |                                       |      |      |      |      |      |
    249  *   `----------------------------------'                                       `----------------------------------'
    250  *                                        ,-------------.       ,-------------.
    251  *                                        |   L  |  J   |       |      |      |
    252  *                                 ,------|------|------|       |------+------+------.
    253  *                                 |      |      |  G   |       |      |      |      |
    254  *                                 | SPACE|  Q   |------        |------|      |      |
    255  *                                 | SHIFT| ALT  | 0MAC |       |      |      |      |
    256  *                                 `--------------------'       `--------------------'
    257  */
    258   [_DIABLO] = LAYOUT_ergodox_pretty_wrapper(
    259              KC_ESC,  KC_V,    KC_D,    KC_LALT, KC_NO,   KC_NO,   KC_NO,                   KC_TRNS, KC_F9,   KC_F10,   KC_F11,  KC_F12,  KC_NO,   KC_NO,
    260              KC_TAB,  KC_S,    KC_I,    KC_F,    KC_M,    KC_T,    KC_TRNS,                 KC_TRNS, KC_NO,   KC_NO,    KC_NO,   KC_NO,   KC_NO,   KC_NO,
    261              KC_Q,    KC_1,    KC_2,    KC_3,    KC_4,    KC_G,                                      KC_NO,   KC_NO,    KC_NO,   KC_NO,   KC_NO,   KC_NO,
    262              KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z,    KC_NO,                   KC_NO,   KC_N,    KC_M,     KC_NO,   KC_NO,   KC_NO,   KC_NO,
    263              KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,                                                       KC_NO,    KC_NO,   KC_NO,   KC_NO,   KC_NO,
    264                                                              KC_L,    KC_J,                 KC_NO,   KC_NO,
    265                                                                       KC_F,                 KC_NO,
    266                           SFT_T(KC_SPACE),  ALT_T(KC_Q),   KC_DIABLO_CLEAR,                 KC_PGDN, KC_DEL,  KC_ENT
    267             ),
    268 
    269   [_LOWER] = LAYOUT_ergodox_pretty_wrapper(
    270              KC_F12,  _________________FUNC_LEFT_________________, _______,                 _______, _________________FUNC_RIGHT________________, KC_F11,
    271              KC_TILD, _________________LOWER_L1__________________, _______,                 _______, _________________LOWER_R1__________________, KC_PIPE,
    272              _______, ___________________BLANK___________________,                                   _________________LOWER_R2__________________, KC_DQUO,
    273              _______, ___________________BLANK___________________, _______,                 _______, _________________LOWER_R3__________________, KC_PSCR,
    274              _______, _______, _______, _______, _______,                                                     _______, _______, _______, _______, KC_PAUS,
    275                                                           _______, _______,                 _______, _______,
    276                                                                    _______,                 _______,
    277                                                  _______, _______, _______,                 _______, _______, _______
    278             ),
    279 
    280   [_RAISE] = LAYOUT_ergodox_pretty_wrapper(
    281              KC_F12,  _________________FUNC_LEFT_________________, _______,                 _______, _________________FUNC_RIGHT________________, KC_F11,
    282              KC_GRV,  _________________RAISE_L1__________________, _______,                 _______, _________________RAISE_R1__________________, KC_BSLS,
    283              _______, _________________RAISE_L2__________________,                                   _________________RAISE_R2__________________, KC_QUOT,
    284              _______, _________________RAISE_L3__________________, _______,                 _______, _________________RAISE_R3__________________, KC_PSCR,
    285              _______, _______, _______, _______, _______,                                                     KC_HOME, KC_PGDN, KC_PGUP, KC_END,  KC_SLCK,
    286                                                           _______, _______,                 _______, _______,
    287                                                                    _______,                 _______,
    288                                                  _______, _______, _______,                 _______, _______, _______
    289             ),
    290 
    291   [_ADJUST] = LAYOUT_ergodox_pretty_wrapper(
    292              KC_MAKE, _______, _______, _______, _______, _______, _______,                 KC_NUKE, _________________ADJUST_R1_________________, KC_RST,
    293              VRSN,    _________________ADJUST_L1_________________, _______,                 _______, _______, _______, _______, _______, _______, EEP_RST,
    294              _______, _________________ADJUST_L2_________________,                                   _________________ADJUST_R2_________________, TG(_MODS),
    295              _______, _________________ADJUST_L3_________________, _______,                 _______, _________________ADJUST_R3_________________, KC_MPLY,
    296              _______, _______, _______, _______, _______,                                                     _______, _______, _______, _______, _______,
    297                                                           _______, _______,                 _______, _______,
    298                                                                    _______,                 _______,
    299                                                  _______, _______, _______,                 _______, _______, _______
    300             ),
    301 
    302 };
    303 // clang-format on
    304 
    305 bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
    306     switch (keycode) {
    307         case KC_1:
    308             if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) {
    309                 if (record->event.pressed) {
    310                     register_code(KC_2);
    311                 } else {
    312                     unregister_code(KC_2);
    313                 }
    314                 return false;
    315             }
    316             break;
    317         case KC_2:
    318             if (IS_LAYER_ON(_GAMEPAD) && userspace_config.swapped_numbers) {
    319                 if (record->event.pressed) {
    320                     register_code(KC_1);
    321                 } else {
    322                     unregister_code(KC_1);
    323                 }
    324                 return false;
    325             }
    326             break;
    327         case KC_SWAP_NUM:
    328             if (record->event.pressed) {
    329                 userspace_config.swapped_numbers ^= 1;
    330                 eeconfig_update_user(userspace_config.raw);
    331             }
    332             break;
    333     }
    334     // switch (keycode) {
    335     //  case KC_P00:
    336     //    if (!record->event.pressed) {
    337     //      register_code(KC_KP_0);
    338     //      unregister_code(KC_KP_0);
    339     //      register_code(KC_KP_0);
    340     //      unregister_code(KC_KP_0);
    341     //    }
    342     //    return false;
    343     //    break;
    344     //}
    345     return true;
    346 }
    347 
    348 void matrix_scan_keymap(void) {  // runs frequently to update info
    349     uint8_t modifiers     = get_mods();
    350     uint8_t led_usb_state = host_keyboard_leds();
    351     uint8_t one_shot      = get_oneshot_mods();
    352 
    353     if (!skip_leds) {
    354         ergodox_board_led_off();
    355         ergodox_right_led_1_off();
    356         ergodox_right_led_2_off();
    357         ergodox_right_led_3_off();
    358 
    359         // Since we're not using the LEDs here for layer indication anymore,
    360         // then lets use them for modifier indicators.  Shame we don't have 4...
    361         // Also, no "else", since we want to know each, independently.
    362         if ((modifiers | one_shot) & MOD_MASK_SHIFT || led_usb_state & (1 << USB_LED_CAPS_LOCK)) {
    363             ergodox_right_led_2_on();
    364             ergodox_right_led_2_set(50);
    365         }
    366         if ((modifiers | one_shot) & MOD_MASK_CTRL) {
    367             ergodox_right_led_1_on();
    368             ergodox_right_led_1_set(10);
    369         }
    370         if ((modifiers | one_shot) & MOD_MASK_ALT) {
    371             ergodox_right_led_3_on();
    372             ergodox_right_led_3_set(10);
    373         }
    374     }
    375 }
    376 
    377 bool indicator_is_this_led_used_keyboard(uint8_t index) {
    378     switch (index) {
    379         case 13 ... 14:
    380             return true;
    381             break;
    382         default:
    383             return false;
    384     }
    385 }
    386 
    387 #ifdef RGB_MATRIX_ENABLE
    388 
    389 void suspend_power_down_keymap(void) { rgb_matrix_set_suspend_state(true); }
    390 
    391 void suspend_wakeup_init_keymap(void) { rgb_matrix_set_suspend_state(false); }
    392 
    393 void rgb_matrix_indicators_user(void) {
    394     if (userspace_config.rgb_layer_change &&
    395 #    ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
    396         !g_suspend_state &&
    397 #    endif
    398 #    if defined(RGBLIGHT_ENABLE)
    399         (!rgblight_config.enable && rgb_matrix_config.enable)
    400 #    else
    401         rgb_matrix_config.enable
    402 #    endif
    403     ) {
    404         switch (biton32(layer_state)) {
    405             case _GAMEPAD:
    406                 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    407                 rgb_matrix_set_color(32, 0x00, 0xFF, 0x00);  // Q
    408                 rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF);  // W
    409                 rgb_matrix_set_color(30, 0xFF, 0x00, 0x00);  // E
    410                 rgb_matrix_set_color(29, 0xFF, 0x80, 0x00);  // R
    411                 rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF);  // A
    412                 rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF);  // S
    413                 rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF);  // D
    414                 rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF);  // F
    415 
    416                 rgb_matrix_set_color(userspace_config.swapped_numbers ? 27 : 26, 0xFF, 0xFF, 0xFF);  // 1
    417                 rgb_matrix_set_color(userspace_config.swapped_numbers ? 26 : 27, 0x00, 0xFF, 0x00);  // 2
    418                 rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF);                                          // 3
    419                 break;
    420             case _DIABLO:
    421                 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER);
    422                 break;
    423             case _RAISE:
    424                 rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    425                 break;
    426             case _LOWER:
    427                 rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    428                 break;
    429             case _ADJUST:
    430                 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    431                 break;
    432             default: {
    433                 bool mods_enabled = IS_LAYER_ON(_MODS);
    434                 switch (biton32(default_layer_state)) {
    435                     case _QWERTY:
    436                         rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    437                         break;
    438                     case _COLEMAK:
    439                         rgb_matrix_layer_helper(HSV_MAGENTA, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    440                         break;
    441                     case _DVORAK:
    442                         rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    443                         break;
    444                     case _WORKMAN:
    445                         rgb_matrix_layer_helper(HSV_GOLDENROD, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    446                         break;
    447                     case _NORMAN:
    448                         rgb_matrix_layer_helper(HSV_CORAL, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    449                         break;
    450                     case _MALTRON:
    451                         rgb_matrix_layer_helper(HSV_YELLOW, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    452                         break;
    453                     case _EUCALYN:
    454                         rgb_matrix_layer_helper(HSV_PINK, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    455                         break;
    456                     case _CARPLAX:
    457                         rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER);
    458                         break;
    459                 }
    460                 break;
    461             }
    462         }
    463     }
    464 }
    465 
    466 #endif  // RGB_MATRIX_INIT