]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/satan/keymaps/default/keymap.c
Update KBD67 readme so that it mentions the KBD65 PCB (#5143)
[qmk_firmware.git] / keyboards / satan / keymaps / default / keymap.c
1 #include QMK_KEYBOARD_H
2
3 enum custom_keycodes {
4   SFT_ESC = SAFE_RANGE
5 };
6
7 // Each layer gets a name for readability, which is then used in the keymap matrix below.
8 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
9 // Layer names don't all need to be of the same length, obviously, and you can also skip them
10 // entirely and just use numbers.
11 enum layer_names {
12   _BL,
13   _FL
14 };
15
16 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17   /* Keymap _BL: (Base Layer) Default Layer
18    * ,-----------------------------------------------------------.
19    * |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backsp|
20    * |-----------------------------------------------------------|
21    * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |  \  |
22    * |-----------------------------------------------------------|
23    * | Caps  | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
24    * |-----------------------------------------------------------|
25    * | Shift  | Z | X | C | V | B | N | M | , | . | / |    Shift |
26    * |-----------------------------------------------------------|
27    * |Ctrl|GUI |Alt |         Space         | Alt| GUI| Fn | Ctrl|
28    * `-----------------------------------------------------------'
29    */
30   [_BL] = LAYOUT_60_ansi(
31     SFT_ESC, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSPC, \
32     KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSLS, \
33     KC_CAPS, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,          KC_ENT,  \
34     KC_LSFT,          KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_RSFT, \
35     KC_LCTL, KC_LGUI, KC_LALT,                            KC_SPC,                             KC_RALT, KC_RGUI, MO(_FL), KC_RCTL
36   ),
37
38   /* Keymap _FL: Function Layer
39    * ,-----------------------------------------------------------.
40    * | ` |   |   |   |   |   |   |   |   |   |   |   |   | Reset |
41    * |-----------------------------------------------------------|
42    * |     |   |   |   |   |   |   |   |   |   |   |BL-|BL+|  BL |
43    * |-----------------------------------------------------------|
44    * |      |   |   |   |   |   |   |   |   |   |   |   |        |
45    * |-----------------------------------------------------------|
46    * |        |   |   |   |   |   |   |   |   |   |   |          |
47    * |-----------------------------------------------------------|
48    * |    |    |    |                        |    |    |    |    |
49    * `-----------------------------------------------------------'
50    */
51   [_FL] = LAYOUT_60_ansi(
52     KC_GRV,  _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,   \
53     _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC,  BL_INC,  BL_TOGG, \
54     _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, \
55     _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______, \
56     _______, _______, _______,                            _______,                            _______, _______, _______, _______
57   )
58 };
59
60 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
61   switch (keycode) {
62     case SFT_ESC:
63       if (record->event.pressed) {
64         if (get_mods() & MOD_MASK_SHIFT) {
65           add_key(KC_GRV);
66           send_keyboard_report();
67         } else {
68           add_key(KC_ESC);
69           send_keyboard_report();
70         }
71       } else {
72         if (get_mods() & MOD_MASK_SHIFT) {
73           del_key(KC_GRV);
74           send_keyboard_report();
75         } else {
76           del_key(KC_ESC);
77           send_keyboard_report();
78         }
79       }
80
81       return false;
82
83     default:
84       return true;
85   }
86 }