]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/planck/keymaps/yale/keymap.c
Merge branch 'master' into coderkun_neo2
[qmk_firmware.git] / keyboards / planck / keymaps / yale / keymap.c
1 // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2 // this is the style you want to emulate.
3 //
4
5 #include "planck.h"
6 #ifdef BACKLIGHT_ENABLE
7         #include "backlight.h"
8 #endif
9
10 // Each layer gets a name for readability, which is then used in the keymap matrix below.
11 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
12 // Layer names don't all need to be of the same length, obviously, and you can also skip them
13 // entirely and just use numbers.
14 #define _QWERTY 0
15 #define _NUM 5
16 #define _FUNC 6
17 #define _NAV 7
18
19 // Fillers to make layering more clear
20 #define _______ KC_TRNS
21 #define XXXXXXX KC_NO
22
23 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24
25 /* _QWERTY
26  * ,-----------------------------------------------------------------------------------.
27  * | Esc  |   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  | Bksp |
28  * |------+------+------+------+------+-------------+------+------+------+------+------|
29  * |Ctrl/Tab| A  |   S  |   D  |   F  |   G  |   H  |   J  |   K  |   L  |   ;  |  "   |
30  * |------+------+------+------+------+------|------+------+------+------+------+------|
31  * | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |Shift |
32  * |------+------+------+------+------+------+------+------+------+------+------+------|
33  * | Ctrl | Alt  | GUI  | GUI  |  Num |    Space    |  FN  |  GUI |  Alt | Ctrl | Enter|
34  * `-----------------------------------------------------------------------------------'
35  */
36 [_QWERTY] = {
37         {KC_ESC,                KC_Q,           KC_W,           KC_E,           KC_R,           KC_T,           KC_Y,           KC_U,           KC_I,           KC_O,           KC_P,           KC_BSPC},
38         {CTL_T(KC_TAB), KC_A,           KC_S,           KC_D,           KC_F,           KC_G,           KC_H,           KC_J,           KC_K,           KC_L,           KC_SCLN,        KC_QUOT},
39         {KC_LSFT,               KC_Z,           KC_X,           KC_C,           KC_V,           KC_B,           KC_N,           KC_M,           KC_COMM,        KC_DOT,         KC_SLSH,        KC_RSFT},
40         {KC_LCTL,               KC_LALT,        KC_LGUI,        KC_LGUI,        MO(_NUM),       KC_SPC,         KC_SPC,         MO(_FUNC),      KC_RGUI,        KC_RALT,        KC_RCTL,        KC_ENT}
41 },
42
43 /* _NUM
44  * ,-----------------------------------------------------------------------------------.
45  * |  ___ |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  | ____ |
46  * |------+------+------+------+------+-------------+------+------+------+------+------|
47  * | Ctrl |   `  |  [   |  {   |  (   |  /   |  \   |   )  |   }  |   ]  |   -  |  =   |
48  * |------+------+------+------+------+------|------+------+------+------+------+------|
49  * | ____ |   !  |  @   |  #   |  $   |  %   |  ^   |  &   |  *   |   _  |   +  | ____ |
50  * |------+------+------+------+------+------+------+------+------+------+------+------|
51  * | ____ | ___  | ___  | ___  | XXXX |    ______   | ____ | ____ | ____ |  __  | ____ |
52  * `-----------------------------------------------------------------------------------'
53  */
54 [_NUM] = {
55         {_______,       KC_1,           KC_2,           KC_3,           KC_4,           KC_5,           KC_6,           KC_7,           KC_8,           KC_9,           KC_0,           _______},
56         {KC_LCTL,       KC_GRV,         KC_LBRC,        KC_LCBR,        KC_LPRN,        KC_SLSH,        KC_BSLS,        KC_RPRN,        KC_RCBR,        KC_RBRC,        KC_MINS,        KC_EQL},
57         {_______,       KC_EXLM,        KC_AT,          KC_HASH,        KC_DLR,         KC_PERC,        KC_CIRC,        KC_AMPR,        KC_ASTR,        KC_UNDS,        KC_PLUS,        _______},
58         {_______,       _______,        _______,        _______,        _______,        _______,        _______,        MO(_NAV),       _______,        _______,        _______,        _______}
59 },
60
61 /* _FUNC
62  * ,-----------------------------------------------------------------------------------.
63  * | ____ |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  | ____ |
64  * |------+------+------+------+------+-------------+------+------+------+------+------|
65  * | ____ |Shift | Ctrl |  Alt |  GUI | ____ | Left | Down |  Up  |Right | Del  | ____ |
66  * |------+------+------+------+------+------|------+------+------+------+------+------|
67  * | ____ |Light | ____ | Vol- | Prev | Play | Mute | Next | Vol+ | ____ | ____ | ____ |
68  * |------+------+------+------+------+------+------+------+------+------+------+------|
69  * | ____ | ____ | ____ | ____ | ____ |    _____    | XXXX | ____ | ____ | ____ | ____ |
70  * `-----------------------------------------------------------------------------------'
71  */
72 [_FUNC] = {
73         {_______,       KC_1,           KC_2,           KC_3,           KC_4,           KC_5,           KC_6,           KC_7,           KC_8,           KC_9,           KC_0,           _______},
74         {_______,       KC_LSFT,        KC_LCTL,        KC_LALT,        KC_LGUI,        _______,        KC_LEFT,        KC_DOWN,        KC_UP,          KC_RGHT,        KC_DEL,         _______},
75         {_______,       M(0),           _______,        KC_VOLD,        KC_MPRV,        KC_MPLY,        KC_MUTE,        KC_MNXT,        KC_VOLU,        _______,        _______,        _______},
76         {_______,       _______,        _______,        _______,        MO(_NAV),       _______,        _______,        _______,        _______,        _______,        _______,        _______}
77 },
78
79 [_NAV] = {
80         {KC_MS_ACCEL2,  KC_FN1,         KC_FN2,         KC_FN3,         KC_FN4,         XXXXXXX,        XXXXXXX,                KC_WH_D,                KC_WH_U,        XXXXXXX,                XXXXXXX,        XXXXXXX},
81         {KC_MS_ACCEL1,  KC_MS_BTN4,     KC_MS_BTN3,     KC_MS_BTN2,     KC_MS_BTN1,     XXXXXXX,        KC_MS_LEFT,             KC_MS_DOWN,             KC_MS_UP,       KC_MS_RIGHT,    XXXXXXX,        XXXXXXX},
82         {KC_MS_ACCEL0,  KC_FN9,         KC_FN10,        KC_FN11,        KC_FN12,        XXXXXXX,        XXXXXXX,                XXXXXXX,                XXXXXXX,        XXXXXXX,                XXXXXXX,        XXXXXXX},
83         {XXXXXXX,               XXXXXXX,        XXXXXXX,        XXXXXXX,        XXXXXXX,        XXXXXXX,        XXXXXXX,                XXXXXXX,                XXXXXXX,        XXXXXXX,                XXXXXXX,        XXXXXXX}
84 },
85
86 };
87
88 const uint16_t PROGMEM fn_actions[] = {
89
90 };
91
92 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
93 {
94         // MACRODOWN only works in this function
95                         switch(id) {
96                                 case 0:
97                                         if (record->event.pressed) {
98                                                 register_code(KC_RSFT);
99                                                 #ifdef BACKLIGHT_ENABLE
100                                                         backlight_step();
101                                                 #endif
102                                         } else {
103                                                 unregister_code(KC_RSFT);
104                                         }
105                                 break;
106                         }
107                 return MACRO_NONE;
108 };