]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/chimera_ergo/keymaps/default/keymap.c
Added Chimera LS and Chimera Ergo (#2335)
[qmk_firmware.git] / keyboards / chimera_ergo / keymaps / default / keymap.c
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_ergo.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_ergo_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_RBRC)
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] = KC_KEYMAP(
48   //,----+----+----+----+----+----.     ,----+----+----+----+----+----.
49      LBRC, 1  ,SCTL,SPLT,SPFN, 5  ,       6  ,GBRC,SPRT,SCTR, 0  ,RBRC,
50   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
51      MESC, Q  , W  , E  , R  , T  ,       Y  , U  , I  , O  , P  ,QUOT,
52   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
53      TAB , A  , S  , D  , F  , G  ,       H  , J  , K  , L  ,SCLN,ENT ,
54   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
55      LSPO, Z  , X  , C  , V  , B  ,       N  , M  ,COMM,DOT ,SLSH,RSPC,
56   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
57                          NMPD,BSPC,      SPC ,SYMB
58   // \------------------+----+----/      \---+----+----+--------------/
59   ),
60
61   [_CAPS] = KC_KEYMAP(
62   //,----+----+----+----+----+----.     ,----+----+----+----+----+----.
63          ,UNDS,    ,    ,    ,    ,          ,    ,    ,    ,    ,    ,
64   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
65          ,    ,    ,    ,    ,    ,          ,    ,    ,    ,    ,    ,
66   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
67          ,    ,    ,    ,    ,    ,          ,    ,    ,    ,COLN,    ,
68   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
69      SCOF,    ,    ,    ,    ,    ,          ,    ,    ,    ,    ,SCOF,
70   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
71                              ,    ,          ,
72   // \------------------+----+----/      \---+----+----+--------------/
73   ),
74
75   [_NUMPAD] = KC_KEYMAP(
76   //,----+----+----+----+----+----.     ,----+----+----+----+----+----.
77          ,    ,    ,    ,    ,    ,          ,    ,    ,    ,MINS,    ,
78   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
79          ,    ,COLN,    ,    ,    ,          , 7  , 8  , 9  ,ASTR,    ,
80   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
81          ,    ,DOT ,    ,    ,    ,          , 4  , 5  , 6  ,PLUS,    ,
82   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
83          ,    ,    ,    ,    ,    ,          , 1  , 2  , 3  ,SLSH,    ,
84   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
85                              ,    ,          , 0
86   // \------------------+----+----/      \---+----+----+--------------/
87   ),
88
89   [_SYMBOLS] = KC_KEYMAP(
90   //,----+----+----+----+----+----.     ,----+----+----+----+----+----.
91          ,    ,    ,    ,    ,    ,          ,    ,    ,    ,    ,    ,
92   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
93          ,EXLM, AT ,HASH,DLR ,PERC,      CIRC,AMPR,ASTR,LPRN,RPRN,BSLS,
94   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
95       F1 , F2 , F3 , F4 , F5 , F6 ,      TILD,EQL ,UNDS,LCBR,RCBR,    ,
96   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
97       F7 , F8 , F9 ,F10 ,F11 ,F12 ,      GRV ,PLUS,MINS,LBRC,RBRC,    ,
98   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
99                          PIPE,    ,          ,
100   // \------------------+----+----/      \---+----+----+--------------/
101   ),
102
103   [_MACROS] = KC_KEYMAP(  
104   //,----+----+----+----+----+----.     ,----+----+----+----+----+----.
105          ,    ,    ,    ,    ,    ,          ,    ,    ,    ,    ,    ,
106   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
107          ,    ,    ,    ,    ,    ,          ,    ,INCL,    ,    ,    ,
108   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
109          ,    ,    ,CAD ,    ,    ,          ,    ,    ,    ,    ,    ,
110   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
111      SCAP,    ,    ,    ,    ,    ,          ,    ,PULL,PUSH,    ,    ,
112   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
113                              ,    ,          ,    
114   // \------------------+----+----/      \---+----+----+--------------/
115   ),
116
117   [_NAV] = KC_KEYMAP(  
118   //,----+----+----+----+----+----.     ,----+----+----+----+----+----.
119          ,    ,    ,    ,    ,    ,          ,    ,    ,    ,    ,    ,
120   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
121          ,    ,    ,    ,    ,    ,          ,PGUP, UP ,PGDN,PSCR,    ,
122   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
123          ,    ,    ,    ,    ,    ,          ,LEFT,DOWN,RGHT,    ,    ,
124   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
125          ,    ,    ,    ,    ,    ,          ,    ,    ,    ,    ,    ,
126   //|----+----+----+----+----+----|     |----+----+----+----+----+----|
127                              ,DEL ,          ,    
128   // \------------------+----+----/      \---+----+----+--------------/
129   ),
130
131
132 };
133
134
135 const uint16_t PROGMEM fn_actions[] = {
136
137 };
138
139 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
140 {
141   switch(id) {
142     /* include some kind of library or header */
143     case 0:
144       if (record->event.pressed) {
145         SEND_STRING("#include <>");
146         return MACRO( T(LEFT), END);
147       }
148       break;
149     case 1:
150       if (record->event.pressed) {
151         SEND_STRING("git pull");
152         return MACRO( T(ENT), END );
153       }
154       break;
155     case 2:
156       if (record->event.pressed){
157         SEND_STRING("git push");
158         return MACRO( T(ENT), END );
159       }
160       break;
161     case 3:
162       if (record->event.pressed){
163         layer_on(_CAPS);
164         register_code(KC_CAPSLOCK);
165         unregister_code(KC_CAPSLOCK);
166       }
167       break;
168     case 4:
169       if (record->event.pressed){
170         layer_off(_CAPS);
171         register_code(KC_CAPSLOCK);
172         unregister_code(KC_CAPSLOCK);
173       }
174       break;
175   }
176   return MACRO_NONE;
177 };
178  
179
180 void matrix_scan_user(void) {
181     uint8_t layer = biton32(layer_state);
182     
183     switch (layer) {
184         case _QWERTY:
185             set_led_green;
186             break;
187         case _CAPS:
188             set_led_white;
189             break;
190         case _NUMPAD:
191             set_led_blue;
192             break;
193         case _SYMBOLS:
194             set_led_red;
195             break;
196         case _NAV:
197             set_led_magenta;
198             break;
199         case _MACROS:
200             set_led_cyan;
201             break;
202        default:
203             set_led_green;
204             break;
205     }
206 };