diff options
Diffstat (limited to 'keyboards/chimera_ls/keymaps')
-rw-r--r-- | keyboards/chimera_ls/keymaps/default/keymap.c | 186 |
1 files changed, 186 insertions, 0 deletions
diff --git a/keyboards/chimera_ls/keymaps/default/keymap.c b/keyboards/chimera_ls/keymaps/default/keymap.c new file mode 100644 index 000000000..0affeef38 --- /dev/null +++ b/keyboards/chimera_ls/keymaps/default/keymap.c | |||
@@ -0,0 +1,186 @@ | |||
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 QMK_KEYBOARD_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_lets_split_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_BSLS) | ||
24 | #define KC_SCTR MT(MOD_LCTL, KC_RBRC) | ||
25 | #define KC_SPLT MT(MOD_LALT, KC_MINS) | ||
26 | #define KC_MESC LT(_MACROS, KC_ESC) | ||
27 | #define KC_CAD LALT(LCTL(KC_DEL)) | ||
28 | |||
29 | enum custom_keycodes { | ||
30 | KC_INCL = SAFE_RANGE, | ||
31 | KC_PULL, | ||
32 | KC_PUSH, | ||
33 | KC_SCAP, | ||
34 | KC_SCOF | ||
35 | }; | ||
36 | |||
37 | #define LONGPRESS_DELAY 150 | ||
38 | //#define LAYER_TOGGLE_DELAY 300 | ||
39 | |||
40 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
41 | |||
42 | [_QWERTY] = LAYOUT_ortho_4x12( | ||
43 | //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. | ||
44 | KC_MESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
45 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
46 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, | ||
47 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
48 | KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, | ||
49 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
50 | KC_SCTL, KC_SPFN, KC_SPLT, KC_AMPR, KC_NMPD, KC_SPC, KC_SPC, KC_SYMB, KC_ASTR, KC_EXLM, KC_LBRC, KC_SCTR | ||
51 | //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' | ||
52 | ), | ||
53 | |||
54 | [_CAPS] = LAYOUT_ortho_4x12( | ||
55 | //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. | ||
56 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
57 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
58 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______, | ||
59 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
60 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
61 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
62 | _______, _______, KC_UNDS, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
63 | //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' | ||
64 | ), | ||
65 | |||
66 | |||
67 | [_NUMPAD] = LAYOUT_ortho_4x12( | ||
68 | //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. | ||
69 | _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_QUOT, | ||
70 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
71 | _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_ENT, | ||
72 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
73 | KC_LSFT, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_ASTR, KC_EQL, | ||
74 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
75 | _______, _______, _______, _______, _______, KC_BSPC, KC_SPC, KC_0, KC_0, KC_DOT, KC_SLSH, _______ | ||
76 | //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' | ||
77 | ), | ||
78 | |||
79 | [_SYMBOLS] = LAYOUT_ortho_4x12( | ||
80 | //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. | ||
81 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_QUOT, | ||
82 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
83 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TILD, KC_EQL, KC_UNDS, KC_LCBR, KC_RCBR, KC_PIPE, | ||
84 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
85 | KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV, KC_PLUS, KC_MINS, KC_LBRC, KC_RBRC, KC_BSLS, | ||
86 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
87 | _______, _______, _______, _______, XXXXXXX, KC_BSPC, KC_SPC, _______, _______, _______, _______, _______ | ||
88 | //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' | ||
89 | ), | ||
90 | |||
91 | [_NAV] = LAYOUT_ortho_4x12( | ||
92 | //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. | ||
93 | _______, _______, _______, _______, KC_DEL, KC_BSPC, _______, KC_HOME, KC_UP, KC_END, KC_INS, KC_PSCR, | ||
94 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
95 | _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______, | ||
96 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
97 | _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, _______, | ||
98 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
99 | _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______ | ||
100 | //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' | ||
101 | ), | ||
102 | |||
103 | [_MACROS] = LAYOUT_ortho_4x12( | ||
104 | //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. | ||
105 | _______, _______, _______, _______, _______, _______, _______, _______, KC_INCL, _______, _______, _______, | ||
106 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
107 | _______, _______, _______, KC_CAD, _______, _______, _______, _______, _______, _______, _______, _______, | ||
108 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
109 | KC_SCAP, _______, _______, _______, _______, _______, _______, _______, KC_PULL, KC_PUSH, _______, KC_SCAP, | ||
110 | //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| | ||
111 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
112 | //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' | ||
113 | ), | ||
114 | |||
115 | }; | ||
116 | |||
117 | |||
118 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
119 | switch(keycode) { | ||
120 | /* include some kind of library or header */ | ||
121 | case KC_INCL: | ||
122 | if (record->event.pressed) { | ||
123 | SEND_STRING("#include <>" SS_TAP(X_LEFT) ); | ||
124 | return false; | ||
125 | } | ||
126 | break; | ||
127 | case KC_PULL: | ||
128 | if (record->event.pressed) { | ||
129 | SEND_STRING("git pull" SS_TAP(X_ENTER) ); | ||
130 | return false; | ||
131 | } | ||
132 | break; | ||
133 | case KC_PUSH: | ||
134 | if (record->event.pressed){ | ||
135 | SEND_STRING("git push" SS_TAP(X_ENTER) ); | ||
136 | return false; | ||
137 | } | ||
138 | break; | ||
139 | case KC_SCAP: | ||
140 | if (record->event.pressed){ | ||
141 | layer_on(_CAPS); | ||
142 | register_code(KC_CAPSLOCK); | ||
143 | unregister_code(KC_CAPSLOCK); | ||
144 | return false; | ||
145 | } | ||
146 | break; | ||
147 | case KC_SCOF: | ||
148 | if (record->event.pressed){ | ||
149 | layer_off(_CAPS); | ||
150 | register_code(KC_CAPSLOCK); | ||
151 | unregister_code(KC_CAPSLOCK); | ||
152 | return false; | ||
153 | } | ||
154 | break; | ||
155 | } | ||
156 | return true; | ||
157 | }; | ||
158 | |||
159 | |||
160 | void matrix_scan_user(void) { | ||
161 | uint8_t layer = biton32(layer_state); | ||
162 | |||
163 | switch (layer) { | ||
164 | case _QWERTY: | ||
165 | set_led_green; | ||
166 | break; | ||
167 | case _CAPS: | ||
168 | set_led_white; | ||
169 | break; | ||
170 | case _NUMPAD: | ||
171 | set_led_blue; | ||
172 | break; | ||
173 | case _SYMBOLS: | ||
174 | set_led_red; | ||
175 | break; | ||
176 | case _NAV: | ||
177 | set_led_magenta; | ||
178 | break; | ||
179 | case _MACROS: | ||
180 | set_led_cyan; | ||
181 | break; | ||
182 | default: | ||
183 | set_led_green; | ||
184 | break; | ||
185 | } | ||
186 | }; | ||