diff options
Diffstat (limited to 'keyboards/chimera_ortho/keymaps/default/keymap.c')
| -rw-r--r-- | keyboards/chimera_ortho/keymaps/default/keymap.c | 193 |
1 files changed, 193 insertions, 0 deletions
diff --git a/keyboards/chimera_ortho/keymaps/default/keymap.c b/keyboards/chimera_ortho/keymaps/default/keymap.c new file mode 100644 index 000000000..ef477e652 --- /dev/null +++ b/keyboards/chimera_ortho/keymaps/default/keymap.c | |||
| @@ -0,0 +1,193 @@ | |||
| 1 | // this is the style you want to emulate. | ||
| 2 | // This is the canonical layout file for the Quantum project. If you want to add another keyboard, | ||
| 3 | |||
| 4 | #include "chimera_ortho.h" | ||
| 5 | |||
| 6 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 7 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 8 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 9 | // entirely and just use numbers. | ||
| 10 | enum chimera_ortho_layers | ||
| 11 | { | ||
| 12 | _QWERTY, | ||
| 13 | _CAPS, | ||
| 14 | _NUMPAD, | ||
| 15 | _SYMBOLS, | ||
| 16 | _MACROS, | ||
| 17 | _NAV | ||
| 18 | }; | ||
| 19 | |||
| 20 | #define KC_NMPD TG(_NUMPAD) | ||
| 21 | #define KC_SYMB TG(_SYMBOLS) | ||
| 22 | #define KC_SPFN LT(_NAV,KC_EQL) | ||
| 23 | #define KC_SCTL MT(MOD_LCTL, KC_LBRC) | ||
| 24 | #define KC_SCTR MT(MOD_LCTL, KC_RBRC) | ||
| 25 | #define KC_SPLT MT(MOD_LALT, KC_MINS) | ||
| 26 | #define KC_SPRT MT(MOD_LALT, KC_1) | ||
| 27 | #define KC_GBRC MT(MOD_RGUI, KC_8) | ||
| 28 | #define KC_GQOT MT(MOD_LGUI, KC_QUOT) | ||
| 29 | #define KC_MESC LT(_MACROS, KC_ESC) | ||
| 30 | #define KC_INCL M(0) | ||
| 31 | #define KC_PULL M(1) | ||
| 32 | #define KC_PUSH M(2) | ||
| 33 | #define KC_SCAP M(3) | ||
| 34 | #define KC_SCOF M(4) | ||
| 35 | #define KC_CAD LALT(LCTL(KC_DEL)) | ||
| 36 | |||
| 37 | #define LONGPRESS_DELAY 150 | ||
| 38 | //#define LAYER_TOGGLE_DELAY 300 | ||
| 39 | |||
| 40 | // Fillers to make layering more clear | ||
| 41 | #define _______ KC_TRNS | ||
| 42 | #define XXXXXXX KC_NO | ||
| 43 | #define KC_ KC_TRNS | ||
| 44 | |||
| 45 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 46 | |||
| 47 | [_QWERTY] = KEYMAP( | ||
| 48 | //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. | ||
| 49 | MESC, Q , W , E , R , T ,SCTL, SCTR, Y , U , I , O , P ,QUOT, | ||
| 50 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 51 | TAB , A , S , D , F , G ,SPLT, SPRT, H , J , K , L ,SCLN,ENT , | ||
| 52 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 53 | LSPO, Z , X , C , V , B ,SPFN, GBRC, N , M ,COMM,DOT ,SLSH,RSPC, | ||
| 54 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 55 | NMPD,BSPC, SPC ,SYMB | ||
| 56 | // \------------------+----+----+---/ \---+----+----+-------------------/ | ||
| 57 | ), | ||
| 58 | |||
| 59 | [_CAPS] = KEYMAP( | ||
| 60 | //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. | ||
| 61 | , , , , , , , , , , , , , , | ||
| 62 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 63 | , , , , , ,UNDS, , , , , ,COLN, , | ||
| 64 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 65 | SCOF, , , , , , , , , , , , ,SCOF, | ||
| 66 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 67 | , , , | ||
| 68 | // \------------------+----+----+---/ \---+----+----+-------------------/ | ||
| 69 | ), | ||
| 70 | |||
| 71 | [_NUMPAD] = KEYMAP( | ||
| 72 | //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. | ||
| 73 | , ,COLN , , , , , , , 7 , 8 , 9 ,ASTR,MINS, | ||
| 74 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 75 | , ,DOT , , , , , , , 4 , 5 , 6 ,PLUS, , | ||
| 76 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 77 | , , , , , , , , , 1 , 2 , 3 ,SLSH, , | ||
| 78 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 79 | , , , 0 | ||
| 80 | // \------------------+----+----+---/ \---+----+----+-------------------/ | ||
| 81 | ), | ||
| 82 | |||
| 83 | [_SYMBOLS] = KEYMAP( | ||
| 84 | //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. | ||
| 85 | ,EXLM, AT ,HASH,DLR ,PERC, , ,CIRC,AMPR,ASTR,LPRN,RPRN,BSLS, | ||
| 86 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 87 | , F1 , F2 , F3 , F4 , F5 , , ,TILD,COLN,UNDS,LCBR,RCBR, , | ||
| 88 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 89 | , F6 , F7 , F8 , F9 ,F10 , , ,GRV ,SCLN,MINS,LBRC,RBRC, , | ||
| 90 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 91 | PIPE, , , | ||
| 92 | // \------------------+----+----+---/ \---+----+----+-------------------/ | ||
| 93 | ), | ||
| 94 | |||
| 95 | [_NAV] = KEYMAP( | ||
| 96 | //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. | ||
| 97 | , , , , , , , , , , UP , ,PSCR, , | ||
| 98 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 99 | , , , , , , , , ,LEFT,DOWN,RGHT, , , | ||
| 100 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 101 | , , , , , , , , ,PGUP,PGDN, , , , | ||
| 102 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 103 | ,DEL , , | ||
| 104 | // \------------------+----+----+---/ \---+----+----+-------------------/ | ||
| 105 | ), | ||
| 106 | |||
| 107 | [_MACROS] = KEYMAP( | ||
| 108 | //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. | ||
| 109 | , , , , , , , , , ,INCL, , , , | ||
| 110 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 111 | , , ,CAD , , , , , , , , , , , | ||
| 112 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 113 | SCAP, , , , , , , , , ,PULL,PUSH, ,SCAP, | ||
| 114 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
| 115 | , , , | ||
| 116 | // \------------------+----+----+---/ \---+----+----+-------------------/ | ||
| 117 | ) | ||
| 118 | |||
| 119 | }; | ||
| 120 | |||
| 121 | |||
| 122 | const uint16_t PROGMEM fn_actions[] = { | ||
| 123 | |||
| 124 | }; | ||
| 125 | |||
| 126 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
| 127 | { | ||
| 128 | switch(id) { | ||
| 129 | /* include some kind of library or header */ | ||
| 130 | case 0: | ||
| 131 | if (record->event.pressed) { | ||
| 132 | SEND_STRING("#include <>"); | ||
| 133 | return MACRO( T(LEFT), END); | ||
| 134 | } | ||
| 135 | break; | ||
| 136 | case 1: | ||
| 137 | if (record->event.pressed) { | ||
| 138 | SEND_STRING("git pull"); | ||
| 139 | return MACRO( T(ENT), END ); | ||
| 140 | } | ||
| 141 | break; | ||
| 142 | case 2: | ||
| 143 | if (record->event.pressed){ | ||
| 144 | SEND_STRING("git push"); | ||
| 145 | return MACRO( T(ENT), END ); | ||
| 146 | } | ||
| 147 | break; | ||
| 148 | case 3: | ||
| 149 | if (record->event.pressed){ | ||
| 150 | layer_on(_CAPS); | ||
| 151 | register_code(KC_CAPSLOCK); | ||
| 152 | unregister_code(KC_CAPSLOCK); | ||
| 153 | } | ||
| 154 | break; | ||
| 155 | case 4: | ||
| 156 | if (record->event.pressed){ | ||
| 157 | layer_off(_CAPS); | ||
| 158 | register_code(KC_CAPSLOCK); | ||
| 159 | unregister_code(KC_CAPSLOCK); | ||
| 160 | } | ||
| 161 | break; | ||
| 162 | } | ||
| 163 | return MACRO_NONE; | ||
| 164 | }; | ||
| 165 | |||
| 166 | |||
| 167 | void matrix_scan_user(void) { | ||
| 168 | uint8_t layer = biton32(layer_state); | ||
| 169 | |||
| 170 | switch (layer) { | ||
| 171 | case _QWERTY: | ||
| 172 | set_led_green; | ||
| 173 | break; | ||
| 174 | case _CAPS: | ||
| 175 | set_led_white; | ||
| 176 | break; | ||
| 177 | case _NUMPAD: | ||
| 178 | set_led_blue; | ||
| 179 | break; | ||
| 180 | case _SYMBOLS: | ||
| 181 | set_led_red; | ||
| 182 | break; | ||
| 183 | case _NAV: | ||
| 184 | set_led_magenta; | ||
| 185 | break; | ||
| 186 | case _MACROS: | ||
| 187 | set_led_cyan; | ||
| 188 | break; | ||
| 189 | default: | ||
| 190 | set_led_green; | ||
| 191 | break; | ||
| 192 | } | ||
| 193 | }; | ||
