summaryrefslogtreecommitdiffstats
path: root/keyboards/xd75/keymaps/skewwhiffy/keymap.c
blob: d25621525c007d1c32cf67b47cc20c7c3ae596ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* Copyright 2017 Kenny Hung
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "xd75.h"
#include "keymap_uk.h"
// Fillers to make layering more clear
#define _______ KC_TRNS
#define ___T___ KC_TRNS
#define XXXXXXX KC_NO

// Layer shorthand
#define _CM 0 // Colemak
#define _QW 1 // Qwerty
#define _DV 2 // Dvorak
#define _NB 3 // Numbers
#define _FN 4 // Function
#define _SYL 5 // Symbols left
#define _SYR 6 // Symbols right
#define _NAV 7 // Navigation

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Colemak _CM
 * .------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
 * |        |              |              |               |              |              |        |        |        |                |        |                  |                |               |        |
 * |--------+--------------+--------------+---------------+--------------+--------------+--------+--------+--------+----------------+--------+------------------+----------------+------------------------|
 * |        | Q            |   W          | F             | P            | G            |        |        |        | J              | L      | U                | Y              | ;             |        |
 * |--------+--------------+--------------+---------------+--------------+--------------+--------+--------+--------+----------------+--------+------------------+----------------+------------------------|
 * |        | A            |   R          | S             | T            | D            |        |        |        | H              | N      | E                | I              | O             | RETURN |
 * |--------+--------------+--------------+---------------+--------------+--------------+--------+--------+--------+----------------+--------+------------------+----------------+------------------------|
 * |        | sft or Z     | nb or X      | sym or C      | V            | nav or B     |        |        |        | nav or K       | M      | sym or ,         | nb or .        | sft or /      |        |
 * |--------+--------------+--------------+---------------+--------------+--------------+--------+--------+--------+----------------+--------+------------------+----------------+------------------------|
 * | LSHIFT | LCTRL        |   LALT       | LGUI          |              | SPACE        | LCTRL  | DEL    | LALT   | BACKSP         |        | RGUI             | RALT           | RCTRL         | RSHIFT |
 * '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
 */	
 [_CM] = {
  { _______, _______,       _______,       _______,        _______,       _______,        _______, _______, _______, _______,        _______, _______,           _______,          _______,        _______ },
  { _______, KC_Q,          KC_W,          KC_F,           KC_P,          KC_G,           _______, _______, _______, KC_J,           KC_L,    KC_U,              KC_Y,             KC_SCLN,        _______ },
  { _______, KC_A,          KC_R,          KC_S,           KC_T,          KC_D,           _______, _______, _______, KC_H,           KC_N,    KC_E,              KC_I,             KC_O,           KC_ENT  },
  { _______, SFT_T(KC_Z),   LT(_NB, KC_X), LT(_SYL, KC_C), KC_V,          LT(_NAV, KC_B), _______, _______, _______, LT(_NAV, KC_K), KC_M,    LT(_SYR, KC_COMM), LT(_FN, KC_DOT),  SFT_T(KC_SLSH), _______ },
  { KC_LSFT, KC_LCTL,       KC_LALT,       KC_LGUI,        LCTL(KC_QUOT), KC_SPC,         KC_LCTL, KC_DEL , KC_LALT, KC_BSPC,        _______, KC_RGUI,           KC_RALT,          KC_RCTL,        KC_RSFT },
 },

/* Numbers _NB / Functions _FN
 * .----------------------------------------------------------------------------------------------------------------------------------------------------.
 * |        |        |              |        |        |        |        |        |        |        |        |        |                |        |        |
 * |--------+--------+--------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+----------------+-----------------|
 * |        |        | F7           | F8     | F9     | F10    |        |        |        |        | 7      | 8      | 9              |        |        |
 * |--------+--------+--------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+----------------+--------+--------|
 * |        |        | F4           | F5     | F6     | F11    |        |        |        |        | 4      | 5      | 6              |        |        |
 * |--------+--------+--------------+--------+--------+--------+--------+--------+--------+--------+--------+----------------------------------+--------|
 * |        |        | F1           | F2     | F3     | F12    |        |        |        |        | 1      | 2      | 3              |        |        |
 * |--------+--------+--------------+--------+--------+--------+--------+--------+--------+--------+--------+-------------------------+--------+--------|
 * |        |        |              |        |        |        |        |        |        |        | 0      | 0      | .              |        |        |
 * '----------------------------------------------------------------------------------------------------------------------------------------------------'
 */
 [_NB] = {
  { _______, _______, _______,       _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,         _______, _______, },
  { _______, _______, KC_F7,         KC_F8,   KC_F9,   KC_F10,  _______, _______, _______, _______, KC_7,    KC_8,    KC_9,            _______, _______  },
  { _______, _______, KC_F4,         KC_F5,   KC_F6,   KC_F11,  _______, _______, _______, _______, KC_4,    KC_5,    KC_6,            _______, _______  },
  { _______, _______, LT(_NB, KC_X), KC_F2,   KC_F3,   KC_F12,  _______, _______, _______, _______, KC_1,    KC_2,    KC_3,            _______, _______  },
  { _______, _______, _______,       _______, _______, _______, _______, _______, _______, _______, KC_0,    KC_0,    KC_DOT,          _______, _______  },
 },
 [_FN] = {
  { _______, _______, _______,       _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,         _______, _______, },
  { _______, _______, KC_F7,         KC_F8,   KC_F9,   KC_F10,  _______, _______, _______, _______, KC_7,    KC_8,    KC_9,            _______, _______  },
  { _______, _______, KC_F4,         KC_F5,   KC_F6,   KC_F11,  _______, _______, _______, _______, KC_5,    KC_5,    KC_6,            _______, _______  },
  { _______, _______, KC_F1,         KC_F2,   KC_F3,   KC_F12,  _______, _______, _______, _______, KC_1,    KC_2,    LT(_FN, KC_DOT), _______, _______  },
  { _______, _______, _______,       _______, _______, _______, _______, _______, _______, _______, KC_0,    KC_0,    KC_DOT,          _______, _______  },
 },

/* Symbols _SYL and _SYR
 * .-------------------------------------------------------------------------------------------------------------------------------------------------------.
 * |        |        |        |               |        |        |        |        |        |        |        |                  |        |        |        |
 * |--------+--------+--------+---------------+--------+--------+--------+--------+--------+--------+--------+------------------+--------+--------+--------|
 * |        | !      | £      | _             | -      | ~      |        |        |        | \      | {      | }                | /      | #      |        |
 * |--------+--------+--------+---------------+--------+--------+--------+--------+--------+--------+--------+------------------+--------+--------+--------|
 * |        | $      | %      | +             | =      |        |        |        |        | "      | (      | )                | '      | @      |        |
 * |--------+--------+--------+---------------+--------+--------+--------+--------+--------+--------+--------+------------------+--------+--------+--------|
 * |        | ^      | &      | *             | |      |        |        |        |        | <      | [      | ]                | >      | `      |        |
 * |--------+--------+--------+---------------+--------+--------+--------+--------+--------+--------+--------+------------------+--------+--------+--------|
 * |        |        |        |               |        |        |        |        |        |        |        |                  |        |        |        |
 * '-------------------------------------------------------------------------------------------------------------------------------------------------------'
 */ 
 [_SYL] = {
  { _______, _______, _______, _______,        _______, _______, _______, _______, _______, _______, _______, _______,           _______, _______, _______  },
  { _______, KC_EXLM, UK_PND,  KC_UNDS,        KC_MINS, KC_TILD, _______, _______, _______, UK_BSLS, KC_LCBR, KC_RCBR,           KC_SLSH, UK_HASH, _______  },
  { _______, KC_DLR,  KC_PERC, KC_PLUS,        KC_EQL,  _______, _______, _______, _______, UK_QUOT, KC_LPRN, KC_RPRN,           KC_QUOT, UK_AT,   _______  },
  { _______, KC_CIRC, KC_AMPR, LT(_SYL, KC_C), UK_PIPE, _______, _______, _______, _______, KC_LABK, KC_LBRC, KC_RBRC,           KC_RABK, KC_GRV,  _______  },
  { _______, _______, _______, _______,        _______, _______, _______, _______, _______, _______, _______, _______,           _______, _______, _______  },
 }, 
 [_SYR] = {
  { _______, _______, _______, _______,        _______, _______, _______, _______, _______, _______, _______, _______,           _______, _______, _______  },
  { _______, KC_EXLM, UK_PND,  KC_UNDS,        KC_MINS, KC_TILD, _______, _______, _______, KC_BSLS, KC_LCBR, KC_RCBR,           KC_SLSH, UK_HASH, _______  },
  { _______, KC_DLR,  KC_PERC, KC_PLUS,        KC_EQL,  _______, _______, _______, _______, UK_QUOT, KC_LPRN, KC_RPRN,           KC_QUOT, UK_AT,   _______  },
  { _______, KC_CIRC, KC_AMPR, KC_ASTR,        UK_PIPE, _______, _______, _______, _______, KC_LABK, KC_LBRC, LT(_SYR, KC_COMM), KC_RABK, KC_GRV,  _______  },
  { _______, _______, _______, _______,        _______, _______, _______, _______, _______, _______, _______, _______,           _______, _______, _______  },
 },
/*
 * Navigation
 * .------------------------------------------------------------------------------------------------------------------------------------------------------------------.
 * |        |          |              |        |              |               |        |        |        |               |        |        |        |        |        |
 * |--------+----------+--------------+--------+--------------+---------------+--------+--------+--------+---------------+--------+--------+--------+--------+--------|
 * |        | Esc      | Ctrl L       | Up     | Ctrl R       |               |        |        |        |               | PtSn   | ScLk   | Pause  |        |        |
 * |--------+----------+--------------+--------+--------------+---------------+--------+--------+--------+---------------+--------+--------+--------+--------+--------|
 * |        | Tab      | Left         | Down   | Right        |               |        |        |        |               | Insert | Home   | PgUp   |        |        |
 * |--------+----------+--------------+--------+--------------+---------------+--------+--------+--------+---------------+--------+--------+--------+--------+--------|
 * |        | ShTab    |              |        |              |               |        |        |        |               | ScLk   | End    | PgDn   |        |        |
 * |--------+----------+--------------+--------+--------------+---------------+--------+--------+--------+---------------+--------+--------+--------+--------+--------|
 * |        |          |              |        |              |               |        |        |        |               |        |        |        |        | RESET  |
 * '------------------------------------------------------------------------------------------------------------------------------------------------------------------'
 */
 [_NAV] = {
  { _______, _______,   _______,       _______, _______,       _______,        _______, _______, _______, _______,        _______, _______, _______, _______, _______  },
  { _______, KC_ESC,    LCTL(KC_LEFT), KC_UP  , LCTL(KC_RGHT), _______,        _______, _______, _______, _______,        KC_PSCR, KC_SLCK, KC_PAUS, _______, _______  },
  { _______, KC_TAB,    KC_LEFT,       KC_DOWN, KC_RGHT,       _______,        _______, _______, _______, _______,        KC_INS,  KC_HOME, KC_PGUP, _______, _______  },
  { _______, S(KC_TAB), _______,       _______, _______,       LT(_NAV, KC_B), _______, _______, _______, LT(_NAV, KC_K), KC_SLCK, KC_END,  KC_PGDN, _______, _______  },
  { _______, _______,   _______,       _______, _______,       _______,        _______, _______, _______, _______,        _______, _______, _______, _______, RESET    },
 },
};

const uint16_t PROGMEM fn_actions[] = {

};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
  // MACRODOWN only works in this function
      switch(id) {
        case 0:
          if (record->event.pressed) {
            register_code(KC_RSFT);
            #ifdef BACKLIGHT_ENABLE
              backlight_step();
            #endif
          } else {
            unregister_code(KC_RSFT);
          }
        break;
      }
    return MACRO_NONE;
};