forked from qmk/qmk_firmware
/
keymap.c
211 lines (182 loc) · 20.8 KB
/
keymap.c
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// This file was originally written for the TOTEM, a keyboard I so far have not
// acclimated to typing on, and so I still mostly type on my Corne. Eventually this
// file will likely be symlinked from several places, and should in general be made
// to handle whatever size keyboard it's thrown at, but for now, it's a Corne-only
// layout despite some optional Totem imports and allusions to things that only
// exist on the TOTEM (like "wing keys").
#include QMK_KEYBOARD_H
#include <stdio.h>
#ifdef KEYBOARD_totem
#include "totem.h"
#endif
#ifdef KEYBOARD_boardsource_unicorne
#define LAYOUT LAYOUT_split_3x6_3
#endif
enum klardotsh_layers {
_DVORAK,
_KEYPAD,
_FKEYS,
_TOPROW,
};
// Ignore this for now. We'll use it later.
enum combos {
JK_ESC,
// Some of the more arcane combos don't make as much sense on a board with a few
// extra edge keys, and I severely notice the typing lag introduced by the combos
// feature, so I want as few of them on my board (especially on my home row/alphas)
// as possible.
#ifndef KEYBOARD_boardsource_unicorne
SQUEST_DASH,
LWIN,
RWIN,
#endif
WINGS_GRVSFT,
};
// Jump to various layers. Easy.
#define KEYPAD MO(_KEYPAD)
#define FKEYS MO(_FKEYS)
#define TOPROW LT(_TOPROW, KC_ENTER)
// When I tap the left thumb, it's a backspace. When I hold it, it's a left
// shift key.
#define SFTBK LSFT_T(KC_BACKSPACE)
// Borrowed from some vim config I found eons ago, mashing J+K gives the escape
// key, because you almost never actually need to press those keys simultaneously
// and this gives a convenient single-hand ESC. This ESC is not a fancy one: it's a
// real, normal ESC with which SHIFT can be combined sanely.
const uint16_t PROGMEM jk_esc_combo[] = {KC_J, KC_K, COMBO_END};
#ifndef KEYBOARD_boardsource_unicorne
// I also need to jam a hyphen in here somewhere, S+? will do.
const uint16_t PROGMEM squest_dash_combo[] = {KC_S, KC_SLASH, COMBO_END};
// Borrowed from @kdb424 who used this on an even-tinier keyboard I played with
// once, give a Super key on each side of the keyboard by pressing middle+ring
// fingers on the home row. In Dvorak, and at least with the way my hands tend to
// rest on the board, this gives me O+E and T+N. The former may eventually give me
// some grief (TBD), but the latter should almost always be fine.
const uint16_t PROGMEM lwin_combo[] = {KC_O, KC_E, COMBO_END};
const uint16_t PROGMEM rwin_combo[] = {KC_T, KC_N, COMBO_END};
#endif
// Because I'm a developer and a Unix user, and also am ~cultured~, I need a ~/
// ` key somewhere on the board. For this, mashing the outermost "wing"/pinky
// keys will suffice. However, there's another combo flow I had in mind for
// this same key: working as an alternative shift key so that I can have a clean
// SHIFT+ENTER ability *somewhere* on the keyboard (recall that SHIFT itself
// makes up part of my ENTER implementation, so SHIFT+ENTER) is problematic. No
// worries, we can mod-tap our way out of this one.
#define GRVSFT RSFT_T(KC_GRV)
const uint16_t PROGMEM wings_grvsft_combo[] = {KC_TAB, KC_SLASH, COMBO_END};
combo_t key_combos[] = {
[JK_ESC] = COMBO(jk_esc_combo, KC_ESCAPE),
#ifndef KEYBOARD_boardsource_unicorne
[SQUEST_DASH] = COMBO(squest_dash_combo, KC_MINUS),
[LWIN] = COMBO(lwin_combo, KC_LWIN),
[RWIN] = COMBO(rwin_combo, KC_RWIN),
#endif
[WINGS_GRVSFT] = COMBO(wings_grvsft_combo, GRVSFT),
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
┌─────────────────────────────────────────────────┐
│ d v o r a k │ ╭╮╭╮╭╮╭╮
└─────────────────────────────────────────────────┘ │╰╯╰╯╰╯│
┌─────────┬─────────┬─────────┬─────────┬──────╨──┐┌──╨──────┬─────────┬─────────┬─────────┬─────────┐
╌┄┈┈───═╡ ' │ , │ . │ P │ Y ││ F │ G │ C │ R │ L │
├─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┤
│ A │ O │ E │ U │ I ││ D │ H │ T │ N │ S │
┌─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┐
│ TAB │ ; │ Q │ J │ K │ X ││ B │ M │ W │ V │ Z │ / │
└─────────┴─────────┴─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┴─────────┴─────────┘
│ CTRL │ TOPROW │BSPC/LSFT││ SPACE │ KEYPAD │ ALT │
└─────────┴─────────┴─────────┘└─────────┴─────────┴─────────┘*/
[_DVORAK] = LAYOUT(
//╷ ╷ ╷ ╷ ╷ ╷ ╷╷ ╷ ╷ ╷ ╷ ╷ ╷
KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
KC_LGUI, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
KC_TAB, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SLASH,
KC_LCTL, TOPROW, SFTBK, KC_SPC, KEYPAD, KC_RALT
),
/*
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
┌─────────────────────────────────────────────────┐
│ k e y p a d │ ╭╮╭╮╭╮╭╮
└─────────────────────────────────────────────────┘ │╰╯╰╯╰╯│
┌─────────┬─────────┬─────────┬─────────┬──────╨──┐┌──╨──────┬─────────┬─────────┬─────────┬─────────┐
╌┄┈┈───═╡ │ ↑ │ │ │ { ││ } │ 7 │ 8 │ 9 │ + │
├─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┤
│ ← │ ↓ │ → │ │ [ ││ ] │ 4 │ 5 │ 6 │ - │
┌─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┐
│ HOME │ END │ PGUP │ PGDN │ │ ( ││ ) │ 1 │ 2 │ 3 │ * │ . │
└─────────┴─────────┴─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┴─────────┴─────────┘
│ │ FKEYS │ ▼ ││ ▼ │ ▼ │ 0 │
└─────────┴─────────┴─────────┘└─────────┴─────────┴─────────┘ */
[_KEYPAD] = LAYOUT(
//╷ ╷ ╷ ╷ ╷ ╷ ╷╷ ╷ ╷ ╷ ╷ ╷ ╷
XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_7, KC_8, KC_9, KC_PLUS, XXXXXXX,
_______, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_MINS, XXXXXXX,
KC_HOME, KC_END, KC_PGUP, KC_PGDN, XXXXXXX, KC_LPRN, KC_RPRN, KC_1, KC_2, KC_3, KC_ASTR, KC_DOT,
_______, FKEYS, _______, _______, _______, KC_0
),
/*
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
┌─────────────────────────────────────────────────┐
│ f k e y s │ ╭╮╭╮╭╮╭╮
└─────────────────────────────────────────────────┘ │╰╯╰╯╰╯│
┌─────────┬─────────┬─────────┬─────────┬──────╨──┐┌──╨──────┬─────────┬─────────┬─────────┬─────────┐
╌┄┈┈───═╡ ▼ │ ▼ │ ▼ │ ▼ │ ▼ ││ ▼ │ F7 │ F8 │ F9 │ F12 │
├─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┤
│ ▼ │ ▼ │ ▼ │ ▼ │ ▼ ││ ▼ │ F4 │ F5 │ F6 │ F11 │
┌─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┐
│ ▼ │ ▼ │ ▼ │ ▼ │ ▼ │ ▼ ││ ▼ │ F1 │ F2 │ F3 │ F10 │ DEL │
└─────────┴─────────┴─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┴─────────┴─────────┘
│ ▼ │ ▼ │ ▼ ││ ▼ │ ▼ │ │
└─────────┴─────────┴─────────┘└─────────┴─────────┴─────────┘ */
[_FKEYS] = LAYOUT(
//╷ ╷ ╷ ╷ ╷ ╷ ╷╷ ╷ ╷ ╷ ╷ ╷ ╷
XXXXXXX, _______, _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, KC_F4, KC_F5, KC_F6, KC_F11, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F10, KC_DEL,
_______, _______, _______, _______, _______, XXXXXXX
),
/*
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
┌─────────────────────────────────────────────────┐
│ t o p r o w │ ╭╮╭╮╭╮╭╮
└─────────────────────────────────────────────────┘ │╰╯╰╯╰╯│
┌─────────┬─────────┬─────────┬─────────┬──────╨──┐┌──╨──────┬─────────┬─────────┬─────────┬─────────┐
╌┄┈┈───═╡ ! │ @ │ # │ $ │ % ││ ^ │ & │ * │ ( │ ) │
├─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┤
│ │ │ │ │ VOLU ││ = │ │ │ │ │
┌─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┐
│ MUTE │ │ B- │ B+ │ │ VOLD ││ INS │ │ │ │ │ \ │
└─────────┴─────────┴─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┴─────────┴─────────┘
│ │ ▼ │ ▼ ││ PLAY │ <<| │ |>> │
└─────────┴─────────┴─────────┘└─────────┴─────────┴─────────┘ */
[_TOPROW] = LAYOUT(
//╷ ╷ ╷ ╷ ╷ ╷ ╷╷ ╷ ╷ ╷ ╷ ╷ ╷
XXXXXXX, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_LPRN, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, KC_EQUAL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_MUTE, XXXXXXX, KC_BRID, KC_BRIU, XXXXXXX, KC_VOLD, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS,
XXXXXXX, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT
),
/*
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
┌─────────────────────────────────────────────────┐
│ t e m p l a t e │ ╭╮╭╮╭╮╭╮
└─────────────────────────────────────────────────┘ │╰╯╰╯╰╯│
┌─────────┬─────────┬─────────┬─────────┬──────╨──┐┌──╨──────┬─────────┬─────────┬─────────┬─────────┐
╌┄┈┈───═╡ │ │ │ │ ││ │ │ │ │ │
├─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┤
│ │ │ │ │ ││ │ │ │ │ │
┌─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┐
│ │ │ │ │ │ ││ │ │ │ │ │ │
└─────────┴─────────┴─────────┼─────────┼─────────┼─────────┤├─────────┼─────────┼─────────┼─────────┴─────────┴─────────┘
│ │ │ ││ │ │ │
└─────────┴─────────┴─────────┘└─────────┴─────────┴─────────┘
[_TEMPLATE] = LAYOUT(
//╷ ╷ ╷ ╷ ╷ ╷ ╷╷ ╷ ╷ ╷ ╷ ╷ ╷
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
),
*/
};